Szelethus planned changes to this revision. Szelethus added a comment. I'll put this patch on hold while I'm investigating the issue @xazax.hun mentioned.
Mind you, again, other patches don't depend strictly on this part, I'll only need to change the for loop. Hopefully. You never know. ================ Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:753 + // macro. + if (const MacroInfo *MI = PP.getMacroInfo(II)) { + getExpandedMacroImpl(Printer, T.getLocation(), PP); ---------------- xazax.hun wrote: > This might not be completely correct. We are using the preprocessor state > after processing the whole translation unit rather than the preprocessor > state at the expansion location. This might not cause any problems unless > there is a collision between macro names and non-macro names. Also, undefs, > redefs might cause troubles. Yup, you're right, I'm afraid :/ I'll investigate whether I can gather the macro definition at the spelling location with `Lexer`. ================ Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:796 + const MacroInfo *MI = PP.getMacroInfo(II); + assert(MI && "This IdentifierInfo should refer to a macro!"); + ---------------- xazax.hun wrote: > Could this assertion fail due to undefs in the code? Yes... yes it could. Repository: rC Clang https://reviews.llvm.org/D52794 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits