]> granicus.if.org Git - clang/commitdiff
a few minor cleanups
authorChris Lattner <sabre@nondot.org>
Mon, 26 Jan 2009 05:30:54 +0000 (05:30 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 26 Jan 2009 05:30:54 +0000 (05:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63000 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPDirectives.cpp

index 4ab293b9b72469f22d9c6adb7947425d74076ec7..1c8f7f1f3a333e435091460954173180279a0323 100644 (file)
@@ -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;
   }