Skip to content

Commit

Permalink
PlistDiagnostics: force the ranges for control-flow edges to be singl…
Browse files Browse the repository at this point in the history
…e locations, forcing

adjacent edges to have compatible ranges.  This simplifies the layout logic for some clients.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158028 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tkremenek committed Jun 5, 2012
1 parent 1ea6744 commit 7453a72
Show file tree
Hide file tree
Showing 7 changed files with 4,556 additions and 4,543 deletions.
12 changes: 10 additions & 2 deletions lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
Loading

0 comments on commit 7453a72

Please sign in to comment.