summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-08-03 23:08:54 +0000
committerJordan Rose <jordan_rose@apple.com>2012-08-03 23:08:54 +0000
commit3eb3cd45b82855486b79e6a01add7899f07970fb (patch)
tree781c05cafe1f5727b2a8b9a34092418c6b04df14 /clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp
parent92e1449b55b8592dbd2b3ac1c740eff701e9ff76 (diff)
downloadbcm5719-llvm-3eb3cd45b82855486b79e6a01add7899f07970fb.tar.gz
bcm5719-llvm-3eb3cd45b82855486b79e6a01add7899f07970fb.zip
[analyzer] Flatten path diagnostics for text output like we do for HTML.
llvm-svn: 161279
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp
index fe912dfd21f..e5b8553aeda 100644
--- a/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp
@@ -42,6 +42,7 @@ public:
bool supportsLogicalOpControlFlow() const { return true; }
bool supportsAllBlockEdges() const { return true; }
virtual bool useVerboseDescription() const { return true; }
+ virtual bool supportsCrossFileDiagnostics() const { return true; }
};
} // end anonymous namespace
@@ -58,7 +59,9 @@ void TextPathDiagnostics::FlushDiagnosticsImpl(
for (std::vector<const PathDiagnostic *>::iterator it = Diags.begin(),
et = Diags.end(); it != et; ++it) {
const PathDiagnostic *D = *it;
- for (PathPieces::const_iterator I = D->path.begin(), E = D->path.end();
+
+ PathPieces FlatPath = D->path.flatten(/*ShouldFlattenMacros=*/true);
+ for (PathPieces::const_iterator I = FlatPath.begin(), E = FlatPath.end();
I != E; ++I) {
unsigned diagID =
Diag.getDiagnosticIDs()->getCustomDiagID(DiagnosticIDs::Note,
OpenPOWER on IntegriCloud