aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-08-24 12:51:04 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-08-24 12:51:04 +0000
commit897e7a38c73a28731f8cdbaa4385ca15ab65820c (patch)
treee8b74ae24fe03c2f34ccb8f7c1aad726ad3d6206
parented5c38682c056c147c8a4abb748b4f285de206dd (diff)
Add a Parser::Diag overload that can receive a custom string along with a SourceRange.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55283 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Parse/Parser.h2
-rw-r--r--lib/Parse/Parser.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index f74960425a..6f9ca22ba9 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -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);
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index a5fe551bfe..c6b0a80e02 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -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);