]> granicus.if.org Git - clang/commitdiff
Add a Parser::Diag overload that can receive a custom string along with a SourceRange.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 24 Aug 2008 12:51:04 +0000 (12:51 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Sun, 24 Aug 2008 12:51:04 +0000 (12:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55283 91177308-0d34-0410-b5e6-96231b3b80d8

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

index f74960425add921b589d0d96dba36186395df801..6f9ca22ba96ac3af9a04a964951ca93e5f0f4bac 100644 (file)
@@ -245,6 +245,8 @@ private:
   bool Diag(SourceLocation Loc, unsigned DiagID,
             const std::string &Msg = std::string());
   bool Diag(SourceLocation Loc, unsigned DiagID, const SourceRange &R);
+  bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
+            SourceRange R1);
   bool Diag(const Token &Tok, unsigned DiagID,
             const std::string &M = std::string()) {
     return Diag(Tok.getLocation(), DiagID, M);
index a5fe551bfecc92270133cfec3154f952fe05fc90..c6b0a80e02eb1db16989fca0c00a2070a95b52c6 100644 (file)
@@ -38,6 +38,12 @@ bool Parser::Diag(SourceLocation Loc, unsigned DiagID,
   return true;
 }
 
+bool Parser::Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg,
+                  SourceRange Range) {
+  Diags.Report(PP.getFullLoc(Loc), DiagID, &Msg, 1, &Range,1);
+  return true;
+}
+
 bool Parser::Diag(SourceLocation Loc, unsigned DiagID, const SourceRange &R) {
   Diags.Report(FullSourceLoc(Loc,PP.getSourceManager()), DiagID, 0, 0,
                &R, 1);