]> granicus.if.org Git - clang/commitdiff
add a new diag helper that takes a range.
authorChris Lattner <sabre@nondot.org>
Sat, 26 Jul 2008 00:16:04 +0000 (00:16 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 26 Jul 2008 00:16:04 +0000 (00:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54081 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Parser.h
lib/Parse/Parser.cpp

index 0287120f0f0b10433c3f9096d0e2ec055e0714b3..a4033a0ca6b2abae412d982412aef6453cff1ce4 100644 (file)
@@ -246,6 +246,7 @@ private:
     
   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);
index 281459a3005b719c10f668f5240c6e1e995c5e60..ef07d3f08ba80117ed6c11be7e742789cc52ec21 100644 (file)
@@ -36,6 +36,12 @@ void Parser::Diag(SourceLocation Loc, unsigned DiagID,
   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