You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
parse the translation unit with CXTranslationUnit_DetailedPreprocessingRecord
upon CXCursor_MacroDefinition, retrieve the macro replacement-list and tokenize them, store in some form like {"foo":[loc0, loc1], "x":[loc2,loc3]}
upon CXCursor_MacroExpansion, record the source location as an occurrence of the macro
while traversing the AST, if the source location appears in the previous step, see if the token occurred in the CXCursor_MacroDefinition step, also attribute the reference to the macro body.
Its nested loop is very inefficient and the design does not work for macros than need to be expanded more than once. This also looks too complicated to me.