[cfe-commits] r131051 - in /cfe/trunk: lib/Frontend/InitPreprocessor.cpp test/Parser/MicrosoftExtensions.cpp
Francois Pichet
pichet2000 at gmail.com
Sat May 7 10:47:38 PDT 2011
Author: fpichet
Date: Sat May 7 12:47:38 2011
New Revision: 131051
URL: http://llvm.org/viewvc/llvm-project?rev=131051&view=rev
Log:
Temporary preprocessor hack to get around the Microsoft __identifier(x) extension.
http://msdn.microsoft.com/en-us/library/hzc8ytsz(v=VS.100).aspx
Microsoft doc claims this is a C++/CLI feature but it is really always enabled.
This removes 2 error when parsing MFC code with clang.
Modified:
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
cfe/trunk/test/Parser/MicrosoftExtensions.cpp
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=131051&r1=131050&r2=131051&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Sat May 7 12:47:38 2011
@@ -343,6 +343,7 @@
// Since we define wchar_t in C++ mode.
Builder.defineMacro("_WCHAR_T_DEFINED");
Builder.defineMacro("_NATIVE_WCHAR_T_DEFINED");
+ Builder.append("#define __identifier(x) x");
Builder.append("class type_info;");
}
Modified: cfe/trunk/test/Parser/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.cpp?rev=131051&r1=131050&r2=131051&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.cpp (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.cpp Sat May 7 12:47:38 2011
@@ -207,3 +207,6 @@
__if_not_exists(IF_EXISTS::Type_not) {
int var244;
}
+
+int __identifier(generic) = 3;
+
More information about the cfe-commits
mailing list