[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 22 15:20:52 PDT 2018


Szelethus updated this revision to Diff 170509.
Szelethus added a comment.

Added a new `macro_expansions` key on the same level at `path` and `notes`, under which the macro expansions are listed, as suggested by @NoQ.

There were a couple ways to make this happen. I could've changed how macro pieces are made in `BugReporter`, so that they are created but the path isn't compacted, but then the  `BugReporter`'s implementation would be complicated by doing specific things specific output formats. I instead decided to manually flatten macro pieces in `PlistDiagnostics`.

Since `FlushDiagnosticsImpl` was already super long, I decided to move both the logic of this patch and the logic for `notes` into a separate function.


https://reviews.llvm.org/D52742

Files:
  include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
  lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
  lib/StaticAnalyzer/Core/BugReporter.cpp
  lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
  test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist
  test/Analysis/plist-macros-with-expansion.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52742.170509.patch
Type: text/x-patch
Size: 26018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181022/bbcd182e/attachment-0001.bin>


More information about the cfe-commits mailing list