[cfe-commits] r55283 - in /cfe/trunk: include/clang/Parse/Parser.h lib/Parse/Parser.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Sun Aug 24 05:51:16 PDT 2008


Author: akirtzidis
Date: Sun Aug 24 07:51:04 2008
New Revision: 55283

URL: http://llvm.org/viewvc/llvm-project?rev=55283&view=rev
Log:
Add a Parser::Diag overload that can receive a custom string along with a SourceRange.

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=55283&r1=55282&r2=55283&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Sun Aug 24 07:51:04 2008
@@ -245,6 +245,8 @@
   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);

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=55283&r1=55282&r2=55283&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Sun Aug 24 07:51:04 2008
@@ -38,6 +38,12 @@
   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);





More information about the cfe-commits mailing list