[PATCH] D52794: [analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 2 04:49:23 PDT 2018


xazax.hun accepted this revision.
xazax.hun added a comment.

One question and one nit otherwise looks good. Feel free to commit once those are resolved without another round of reviews.



================
Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:805
+    // macro.
+    if (const MacroInfo *MI = PP.getMacroInfo(II)) {
+      getMacroNameAndPrintExpansion(Printer, T.getLocation(), PP);
----------------
Can't we have troubles with getMacroInfo + undefs here? Wouldn't `findDirectiveAtLoc` be a safer choice here?


================
Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:883
+
+inline void TokenPrinter::printToken(const Token &Tok) {
+  // If the tokens were already space separated, or if they must be to avoid
----------------
I would remove the inline keyword here. I rarely see this in clang codebase. Let's just trust the compiler :)


https://reviews.llvm.org/D52794





More information about the cfe-commits mailing list