[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 16 15:28:20 PDT 2018
NoQ added inline comments.
================
Comment at: lib/StaticAnalyzer/Core/AnalyzerOptions.cpp:469
+ DisplayMacroExpansions =
+ getBooleanOption("expand-macros", /*Default=*/false);
+ return DisplayMacroExpansions.getValue();
----------------
Should we say something about plists in the option name?
================
Comment at: test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist:44-54
+ <dict>
+ <key>kind</key><string>macro_expansion</string>
+ <key>location</key>
+ <dict>
+ <key>line</key><integer>26</integer>
+ <key>col</key><integer>3</integer>
+ <key>file</key><integer>0</integer>
----------------
Because we're adding an element of an `<array>` rather than a key of a `<dict>`, I'm not entirely sure this is backwards compatible. Clients may crash if they iterate over the `path` array and encounter an unexpected element kind. Is it going to be bad for your use case if we put expansions into a separate array alongside the `path` array?
https://reviews.llvm.org/D52742
More information about the cfe-commits
mailing list