add a new diag helper that takes a range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54081 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index 0287120..a4033a0 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -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);
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 281459a..ef07d3f 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -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