summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-18 22:45:06 +0000
committerChris Lattner <sabre@nondot.org>2010-06-18 22:45:06 +0000
commited8b6b799dbadbdbaa2b58c5e255cb3e9e444552 (patch)
treef89f41eb1d60d3a784b19f4ed36e6b4599b13063 /clang/lib/Checker
parent6860bb7796477f78fe8337b27031e64690be0a0d (diff)
downloadbcm5719-llvm-ed8b6b799dbadbdbaa2b58c5e255cb3e9e444552.tar.gz
bcm5719-llvm-ed8b6b799dbadbdbaa2b58c5e255cb3e9e444552.zip
introduce a new CharSourceRange class, and enhance the diagnostics routines
to use them instead of SourceRange. CharSourceRange is just a SourceRange plus a bool that indicates whether the range has the end character resolved or whether the end location is the start of the end token. While most of the compiler wants to think of ranges that have ends that are the start of the end token, the printf diagnostic stuff wants to highlight ranges within tokens. This is transparent to the diagnostic stuff. To start taking advantage of the new capabilities, you can do something like this: Diag(..) << CharSourceRange::getCharRange(Begin,End) llvm-svn: 106338
Diffstat (limited to 'clang/lib/Checker')
-rw-r--r--clang/lib/Checker/PathDiagnostic.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Checker/PathDiagnostic.cpp b/clang/lib/Checker/PathDiagnostic.cpp
index 963923c9ad1..6e6c7496f1d 100644
--- a/clang/lib/Checker/PathDiagnostic.cpp
+++ b/clang/lib/Checker/PathDiagnostic.cpp
@@ -107,7 +107,7 @@ void PathDiagnosticClient::HandleDiagnostic(Diagnostic::Level DiagLevel,
new PathDiagnosticEventPiece(Info.getLocation(), StrC.str());
for (unsigned i = 0, e = Info.getNumRanges(); i != e; ++i)
- P->addRange(Info.getRange(i));
+ P->addRange(Info.getRange(i).getAsRange());
for (unsigned i = 0, e = Info.getNumFixItHints(); i != e; ++i)
P->addFixItHint(Info.getFixItHint(i));
D->push_front(P);
OpenPOWER on IntegriCloud