r184240 - Make sure the assembler-with-cpp hack for "#" works with multiple "#"s in
Eli Friedman
eli.friedman at gmail.com
Tue Jun 18 14:33:38 PDT 2013
Author: efriedma
Date: Tue Jun 18 16:33:38 2013
New Revision: 184240
URL: http://llvm.org/viewvc/llvm-project?rev=184240&view=rev
Log:
Make sure the assembler-with-cpp hack for "#" works with multiple "#"s in
succession. Fixes PR16363.
Modified:
cfe/trunk/lib/Lex/PPDirectives.cpp
cfe/trunk/test/Preprocessor/assembler-with-cpp.c
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=184240&r1=184239&r2=184240&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Tue Jun 18 16:33:38 2013
@@ -1920,6 +1920,8 @@ void Preprocessor::HandleDefineDirective
// confused.
if (getLangOpts().AsmPreprocessor && Tok.isNot(tok::eod)) {
LastTok.setKind(tok::unknown);
+ MI->AddTokenToBody(LastTok);
+ continue;
} else {
Diag(Tok, diag::err_pp_stringize_not_parameter);
ReleaseMacroInfo(MI);
Modified: cfe/trunk/test/Preprocessor/assembler-with-cpp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/assembler-with-cpp.c?rev=184240&r1=184239&r2=184240&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/assembler-with-cpp.c (original)
+++ cfe/trunk/test/Preprocessor/assembler-with-cpp.c Tue Jun 18 16:33:38 2013
@@ -77,3 +77,7 @@
// rdar://8823139
# ##
// CHECK-Identifiers-False: # ##
+
+#define X(a) # # # 1
+X(1)
+// CHECK-Identifiers-False: # # # 1
More information about the cfe-commits
mailing list