[cfe-commits] r54081 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/Parser.cpp
Chris Lattner
sabre at nondot.org
Fri Jul 25 17:16:04 PDT 2008
Author: lattner
Date: Fri Jul 25 19:16:04 2008
New Revision: 54081
URL: http://llvm.org/viewvc/llvm-project?rev=54081&view=rev
Log:
add a new diag helper that takes a range.
Modified:
cfe/trunk/include/clang/Parse/Parser.h
cfe/trunk/lib/Parse/Parser.cpp
Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=54081&r1=54080&r2=54081&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Fri Jul 25 19:16:04 2008
@@ -246,6 +246,7 @@
void Diag(SourceLocation Loc, unsigned DiagID,
const std::string &Msg = std::string());
+ void Diag(SourceLocation Loc, unsigned DiagID, const SourceRange &R);
void Diag(const Token &Tok, unsigned DiagID,
const std::string &M = std::string()) {
Diag(Tok.getLocation(), DiagID, M);
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=54081&r1=54080&r2=54081&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Fri Jul 25 19:16:04 2008
@@ -36,6 +36,12 @@
Diags.Report(FullSourceLoc(Loc,PP.getSourceManager()), DiagID, &Msg, 1);
}
+void Parser::Diag(SourceLocation Loc, unsigned DiagID, const SourceRange &R) {
+ Diags.Report(FullSourceLoc(Loc,PP.getSourceManager()), DiagID, 0, 0,
+ &R, 1);
+}
+
+
/// MatchRHSPunctuation - For punctuation with a LHS and RHS (e.g. '['/']'),
/// this helper function matches and consumes the specified RHS token if
/// present. If not present, it emits the specified diagnostic indicating
More information about the cfe-commits
mailing list