]> granicus.if.org Git - clang/commitdiff
silence some errors that should not apply to .S files on code like:
authorChris Lattner <sabre@nondot.org>
Wed, 18 Mar 2009 21:10:12 +0000 (21:10 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 18 Mar 2009 21:10:12 +0000 (21:10 +0000)
''
   '
 '

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67237 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp

index 0478eebb62376b8d6a1448621d4b338fb213d8c0..a8a22ebc3517f1aca4a2e0f20bc286077ea09c8b 100644 (file)
@@ -653,7 +653,7 @@ void Lexer::LexStringLiteral(Token &Result, const char *CurPtr, bool Wide) {
       C = getAndAdvanceChar(CurPtr, Result);
     } else if (C == '\n' || C == '\r' ||             // Newline.
                (C == 0 && CurPtr-1 == BufferEnd)) {  // End of file.
-      if (!isLexingRawMode())
+      if (!isLexingRawMode() && !Features.AsmPreprocessor)
         Diag(BufferPtr, diag::err_unterminated_string);
       FormTokenWithChars(Result, CurPtr-1, tok::unknown);
       return;
@@ -687,7 +687,7 @@ void Lexer::LexAngledStringLiteral(Token &Result, const char *CurPtr) {
       C = getAndAdvanceChar(CurPtr, Result);
     } else if (C == '\n' || C == '\r' ||             // Newline.
                (C == 0 && CurPtr-1 == BufferEnd)) {  // End of file.
-      if (!isLexingRawMode())
+      if (!isLexingRawMode() && !Features.AsmPreprocessor)
         Diag(BufferPtr, diag::err_unterminated_angled_string);
       FormTokenWithChars(Result, CurPtr-1, tok::unknown);
       return;
@@ -716,7 +716,7 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr) {
   // Handle the common case of 'x' and '\y' efficiently.
   char C = getAndAdvanceChar(CurPtr, Result);
   if (C == '\'') {
-    if (!isLexingRawMode())
+    if (!isLexingRawMode() && !Features.AsmPreprocessor)
       Diag(BufferPtr, diag::err_empty_character);
     FormTokenWithChars(Result, CurPtr, tok::unknown);
     return;
@@ -737,7 +737,7 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr) {
         C = getAndAdvanceChar(CurPtr, Result);
       } else if (C == '\n' || C == '\r' ||               // Newline.
                  (C == 0 && CurPtr-1 == BufferEnd)) {    // End of file.
-        if (!isLexingRawMode())
+        if (!isLexingRawMode() && !Features.AsmPreprocessor)
           Diag(BufferPtr, diag::err_unterminated_char);
         FormTokenWithChars(Result, CurPtr-1, tok::unknown);
         return;