diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-18 07:48:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-18 07:48:38 +0000 |
commit | 1ab3b96de160e4fbffec2a776e284a48a3bb543d (patch) | |
tree | 9ab728aaab0602c9e14a93602a50d62932a74f5e /include/clang/Parse/Parser.h | |
parent | d3b64655fa81ff1e1d5f944198239e4908035d79 (diff) |
Change a couple of the Parser::Diag methods to return DiagnosticInfo
and let the clients push whatever they want into the DiagnosticInfo
instead of hard coding a few forms. Also switch various clients to
use Diag(Tok, ...) instead of Diag(Tok.getLocation(), ...) as the
canonical form to simplify the code a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Parse/Parser.h')
-rw-r--r-- | include/clang/Parse/Parser.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index e6d3464c76..e6d7df5d37 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -27,6 +27,7 @@ namespace clang { class ObjCDeclSpec; class PragmaHandler; class Scope; + class DiagnosticInfo; /// Parser - This implements a parser for the C family of languages. After /// parsing units of the grammar, productions are invoked to handle whatever has @@ -312,15 +313,11 @@ private: //===--------------------------------------------------------------------===// // Diagnostic Emission and Error recovery. - bool Diag(SourceLocation Loc, unsigned DiagID, - const std::string &Msg = std::string()); + DiagnosticInfo Diag(SourceLocation Loc, unsigned DiagID); + DiagnosticInfo Diag(const Token &Tok, unsigned DiagID); bool Diag(SourceLocation Loc, unsigned DiagID, const SourceRange &R); bool Diag(SourceLocation Loc, unsigned DiagID, const std::string &Msg, const SourceRange& R1); - bool Diag(const Token &Tok, unsigned DiagID, - const std::string &M = std::string()) { - return Diag(Tok.getLocation(), DiagID, M); - } /// SkipUntil - Read tokens until we get to the specified token, then consume /// it (unless DontConsume is true). Because we cannot guarantee that the |