summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
diff options
context:
space:
mode:
authorKristof Umann <dkszelethus@gmail.com>2018-10-31 14:54:27 +0000
committerKristof Umann <dkszelethus@gmail.com>2018-10-31 14:54:27 +0000
commit7d6d9eb6889c3f78a4466488d03744e408f39f1c (patch)
tree04e14549693613ab98fca25a81d74556ae52118e /clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
parent412ed34744d45dae98e5d2eea8f96993d48b7b79 (diff)
downloadbcm5719-llvm-7d6d9eb6889c3f78a4466488d03744e408f39f1c.tar.gz
bcm5719-llvm-7d6d9eb6889c3f78a4466488d03744e408f39f1c.zip
[analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag
This is the first part of the implementation of the inclusion of macro expansions into the plist output. It adds a new flag that adds a new "macro_expansions" entry to each report that has PathDiagnosticPieces that were expanded from a macro. While there's an entry for each macro expansion, both the name of the macro and what it expands to is missing, and will be implemented in followup patches. Differential Revision: https://reviews.llvm.org/D52742 llvm-svn: 345724
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
index d300119e6c1..cde2f4c2591 100644
--- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
+++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
@@ -464,6 +464,13 @@ bool AnalyzerOptions::shouldDisplayNotesAsEvents() {
return DisplayNotesAsEvents.getValue();
}
+bool AnalyzerOptions::shouldDisplayMacroExpansions() {
+ if (!DisplayMacroExpansions.hasValue())
+ DisplayMacroExpansions =
+ getBooleanOption("expand-macros", /*Default=*/false);
+ return DisplayMacroExpansions.getValue();
+}
+
bool AnalyzerOptions::shouldAggressivelySimplifyBinaryOperation() {
if (!AggressiveBinaryOperationSimplification.hasValue())
AggressiveBinaryOperationSimplification =
OpenPOWER on IntegriCloud