summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-26 05:30:54 +0000
committerChris Lattner <sabre@nondot.org>2009-01-26 05:30:54 +0000
commit38d7fd252a6de1aa6ea25e4f747e6711990833dd (patch)
tree2cf5f7ad5de6dbca518e0a959ebe2f688b9c805b /clang/lib
parent100c65e8109e1ef9fc7fc24f27597947e60decb4 (diff)
downloadbcm5719-llvm-38d7fd252a6de1aa6ea25e4f747e6711990833dd.tar.gz
bcm5719-llvm-38d7fd252a6de1aa6ea25e4f747e6711990833dd.zip
a few minor cleanups
llvm-svn: 63000
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 4ab293b9b72..1c8f7f1f3a3 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -629,10 +629,12 @@ void Preprocessor::HandleLineDirective(Token &Tok) {
// FIXME: do something with the #line info.
}
-
+/// HandleUserDiagnosticDirective - Handle a #warning or #error directive.
+///
void Preprocessor::HandleUserDiagnosticDirective(Token &Tok,
bool isWarning) {
- if (!CurLexer)
+ // PTH doesn't emit #warning or #error directives.
+ if (CurPTHLexer)
return CurPTHLexer->DiscardToEndOfLine();
// Read the rest of the line raw. We do this because we don't want macros
@@ -661,6 +663,8 @@ void Preprocessor::HandleIdentSCCSDirective(Token &Tok) {
if (StrTok.isNot(tok::string_literal) &&
StrTok.isNot(tok::wide_string_literal)) {
Diag(StrTok, diag::err_pp_malformed_ident);
+ if (StrTok.isNot(tok::eom))
+ DiscardUntilEndOfDirective();
return;
}
OpenPOWER on IntegriCloud