Count a dirty epoch on functions and on the type database ##analysis - #26706
Open
0verflowme wants to merge 1 commit into
Open
Count a dirty epoch on functions and on the type database ##analysis#267060verflowme wants to merge 1 commit into
0verflowme wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Anything that caches work derived from a function's typed metadata, or from the type database, needs to know when that input changed.
has_changedis a flag that one consumer clears, so a second consumer never sees the change. An epoch is a counter that only moves forward, and every consumer keeps the value it last saw.RAnalFunction.dirty_epoch, bumped byr_anal_function_bump_dirty_epoch, on: relocate, rename, variable set/rename/retype, signature set, calling convention change,afB,afS, and whenr_anal_function_ccresolves a lazy dyncc marker. Zero is never a valid value, so a consumer that starts from zero always sees the first change.RAnal.type_dirty_epoch, bumped byr_anal_types_bump_dirty_epoch, on: type database loads and reloads, parsed type save and remove, base type save, signature delete, and type links. The link writers (r_type_set_link,r_type_link_offset,r_type_unlink) do not seeRAnal, sor_anal_types_set_link,r_anal_types_set_link_offsetandr_anal_types_unlinkwrap them and the three core callers go through the wrappers.r_anal_function_set_callconvvalidates the convention and bumps;afcuses it instead of writingfcn->callconvdirectly.The function bump also sets
has_changed, so existing readers of that flag keep working.test_anal_functionchecks that relocate and rename move the epoch.Split out of #26701.