summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-06-05 22:00:52 +0000
committerTed Kremenek <kremenek@apple.com>2012-06-05 22:00:52 +0000
commit54baf2e57dd3cd39f35b4cf8c1b644cf617ba907 (patch)
treea66a093e4f6e67c2180447b103205553066651ab /clang/lib
parent989b3b1516bf94f0a8aee017c2b3015895acc651 (diff)
downloadbcm5719-llvm-54baf2e57dd3cd39f35b4cf8c1b644cf617ba907.tar.gz
bcm5719-llvm-54baf2e57dd3cd39f35b4cf8c1b644cf617ba907.zip
PlistDiagnostics: force the ranges for control-flow edges to be single locations, forcing
adjacent edges to have compatible ranges. This simplifies the layout logic for some clients. llvm-svn: 158028
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
index c3f7c0e810c..f1c620a018a 100644
--- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
@@ -183,10 +183,18 @@ static void ReportControlFlow(raw_ostream &o,
I!=E; ++I) {
Indent(o, indent) << "<dict>\n";
++indent;
+
+ // Make the ranges of the start and end point self-consistent with adjacent edges
+ // by forcing to use only the beginning of the range. This simplifies the layout
+ // logic for clients.
Indent(o, indent) << "<key>start</key>\n";
- EmitRange(o, SM, LangOpts, I->getStart().asRange(), FM, indent+1);
+ SourceLocation StartEdge = I->getStart().asRange().getBegin();
+ EmitRange(o, SM, LangOpts, SourceRange(StartEdge, StartEdge), FM, indent+1);
+
Indent(o, indent) << "<key>end</key>\n";
- EmitRange(o, SM, LangOpts, I->getEnd().asRange(), FM, indent+1);
+ SourceLocation EndEdge = I->getEnd().asRange().getBegin();
+ EmitRange(o, SM, LangOpts, SourceRange(EndEdge, EndEdge), FM, indent+1);
+
--indent;
Indent(o, indent) << "</dict>\n";
}
OpenPOWER on IntegriCloud