[cfe-commits] r39158 - in /cfe/cfe/trunk: Parse/ParseObjc.cpp Parse/Parser.cpp include/clang/Parse/Parser.h
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:40:09 PDT 2007
Author: sabre
Date: Wed Jul 11 11:40:08 2007
New Revision: 39158
URL: http://llvm.org/viewvc/llvm-project?rev=39158&view=rev
Log:
remove diag helper that implicitly reports the diagnostic at the current
token: it is better for the code to be explicit.
Modified:
cfe/cfe/trunk/Parse/ParseObjc.cpp
cfe/cfe/trunk/Parse/Parser.cpp
cfe/cfe/trunk/include/clang/Parse/Parser.h
Modified: cfe/cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/ParseObjc.cpp?rev=39158&r1=39157&r2=39158&view=diff
==============================================================================
--- cfe/cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/cfe/trunk/Parse/ParseObjc.cpp Wed Jul 11 11:40:08 2007
@@ -59,7 +59,7 @@
while (1) {
if (Tok.getKind() != tok::identifier) {
- Diag(diag::err_expected_ident);
+ Diag(Tok, diag::err_expected_ident);
SkipUntil(tok::semi);
return;
}
Modified: cfe/cfe/trunk/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Parse/Parser.cpp?rev=39158&r1=39157&r2=39158&view=diff
==============================================================================
--- cfe/cfe/trunk/Parse/Parser.cpp (original)
+++ cfe/cfe/trunk/Parse/Parser.cpp Wed Jul 11 11:40:08 2007
@@ -245,7 +245,7 @@
}
if (Tok.getKind() == tok::eof) // Empty source file is an extension.
- Diag(diag::ext_empty_source_file);
+ Diag(Tok, diag::ext_empty_source_file);
}
/// ParseTopLevelDecl - Parse one top-level declaration, return whatever the
@@ -299,7 +299,7 @@
Parser::DeclTy *Parser::ParseExternalDeclaration() {
switch (Tok.getKind()) {
case tok::semi:
- Diag(diag::ext_top_level_semi);
+ Diag(Tok, diag::ext_top_level_semi);
ConsumeToken();
// TODO: Invoke action for top-level semicolon.
return 0;
Modified: cfe/cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Parse/Parser.h?rev=39158&r1=39157&r2=39158&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/cfe/trunk/include/clang/Parse/Parser.h Wed Jul 11 11:40:08 2007
@@ -219,9 +219,6 @@
const std::string &M = std::string()) {
Diag(Tok.getLocation(), DiagID, M);
}
- void Diag(unsigned DiagID, const std::string &Msg = std::string()) {
- Diag(Tok, DiagID, Msg);
- }
/// SkipUntil - Read tokens until we get to the specified token, then consume
/// it (unless DontConsume is false). Because we cannot guarantee that the
More information about the cfe-commits
mailing list