diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Analysis/PathDiagnostic.cpp | 5 | ||||
-rw-r--r-- | clang/lib/Frontend/PlistDiagnostics.cpp | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Analysis/PathDiagnostic.cpp b/clang/lib/Analysis/PathDiagnostic.cpp index fa075a39595..946548e02cc 100644 --- a/clang/lib/Analysis/PathDiagnostic.cpp +++ b/clang/lib/Analysis/PathDiagnostic.cpp @@ -158,12 +158,13 @@ FullSourceLoc PathDiagnosticLocation::asLocation() const { return FullSourceLoc(R.getBegin(), const_cast<SourceManager&>(*SM)); } -SourceRange PathDiagnosticLocation::asRange() const { +PathDiagnosticRange PathDiagnosticLocation::asRange() const { assert(isValid()); // Note that we want a 'switch' here so that the compiler can warn us in // case we add more cases. switch (K) { case SingleLocK: + return PathDiagnosticRange(R, true); case RangeK: break; case StmtK: { @@ -201,7 +202,7 @@ SourceRange PathDiagnosticLocation::asRange() const { } else { SourceLocation L = D->getLocation(); - return SourceRange(L, L); + return PathDiagnosticRange(SourceRange(L, L), true); } } diff --git a/clang/lib/Frontend/PlistDiagnostics.cpp b/clang/lib/Frontend/PlistDiagnostics.cpp index d67740aa9d6..7ad900e8741 100644 --- a/clang/lib/Frontend/PlistDiagnostics.cpp +++ b/clang/lib/Frontend/PlistDiagnostics.cpp @@ -111,11 +111,11 @@ static void EmitLocation(llvm::raw_ostream& o, const SourceManager &SM, static void EmitRange(llvm::raw_ostream& o, const SourceManager &SM, const LangOptions &LangOpts, - SourceRange R, const FIDMap &FM, + PathDiagnosticRange R, const FIDMap &FM, unsigned indent) { Indent(o, indent) << "<array>\n"; EmitLocation(o, SM, LangOpts, R.getBegin(), FM, indent+1); - EmitLocation(o, SM, LangOpts, R.getEnd(), FM, indent+1, true); + EmitLocation(o, SM, LangOpts, R.getEnd(), FM, indent+1, !R.isPoint); Indent(o, indent) << "</array>\n"; } |