[PATCH] D94673: [analyzer][CTU] API for CTU macro expansions

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 17 03:43:38 PST 2021


balazske accepted this revision.
balazske added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:835
+          CTU.getMacroExpansionContextForSourceLocation(MacroExpansionLoc)) {
+    return CTUMacroExpCtx->getExpandedText(MacroExpansionLoc);
   }
----------------
I am not sure if `getExpandedText` will handle a source location that is not in the same TU. Probably the previous source location mapping mechanism (that is now removed) is needed additionally, so that here the original source location and the original `MacroExpansionContext` is available. Probably this can be done in other way, the `MacroExpansionContext` could handle this mapping. (A single `MacroExpansionContext` could handle every imported source location at least for on-demand parsing.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94673/new/

https://reviews.llvm.org/D94673



More information about the cfe-commits mailing list