[cfe-commits] r92025 - in /cfe/trunk: lib/Lex/MacroArgs.cpp test/Parser/MicrosoftExtensions.c
Chris Lattner
sabre at nondot.org
Wed Dec 23 11:15:27 PST 2009
Author: lattner
Date: Wed Dec 23 13:15:27 2009
New Revision: 92025
URL: http://llvm.org/viewvc/llvm-project?rev=92025&view=rev
Log:
fix the microsoft "charify" extension to return the charified token
as a character literal, not a string literal. This might fix
rdar://7486575
Modified:
cfe/trunk/lib/Lex/MacroArgs.cpp
cfe/trunk/test/Parser/MicrosoftExtensions.c
Modified: cfe/trunk/lib/Lex/MacroArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/MacroArgs.cpp?rev=92025&r1=92024&r2=92025&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/MacroArgs.cpp (original)
+++ cfe/trunk/lib/Lex/MacroArgs.cpp Wed Dec 23 13:15:27 2009
@@ -178,7 +178,7 @@
Preprocessor &PP, bool Charify) {
Token Tok;
Tok.startToken();
- Tok.setKind(tok::string_literal);
+ Tok.setKind(Charify ? tok::char_constant : tok::string_literal);
const Token *ArgTokStart = ArgToks;
Modified: cfe/trunk/test/Parser/MicrosoftExtensions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.c?rev=92025&r1=92024&r2=92025&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.c (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.c Wed Dec 23 13:15:27 2009
@@ -28,3 +28,9 @@
}
typedef bool (__stdcall __stdcall *blarg)(int);
+
+
+// Charify extension.
+#define FOO(x) #@x
+char x = FOO(a);
+
More information about the cfe-commits
mailing list