[cfe-commits] r113434 - in /cfe/trunk: include/clang/Basic/TokenKinds.def test/SemaCXX/borland-extensions.cpp
Dawn Perchik
dawn at burble.org
Wed Sep 8 15:56:24 PDT 2010
Author: dperchik
Date: Wed Sep 8 17:56:24 2010
New Revision: 113434
URL: http://llvm.org/viewvc/llvm-project?rev=113434&view=rev
Log:
Add support for a few MS extensions supported by the Borland compiler
(__uuidof, _fastcall, etc.).
Modified:
cfe/trunk/include/clang/Basic/TokenKinds.def
cfe/trunk/test/SemaCXX/borland-extensions.cpp
Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=113434&r1=113433&r2=113434&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Wed Sep 8 17:56:24 2010
@@ -336,7 +336,7 @@
KEYWORD(__thiscall , KEYALL)
KEYWORD(__forceinline , KEYALL)
-// Borland Extension.
+// Borland Extensions.
KEYWORD(__pascal , KEYALL)
// Altivec Extension.
@@ -369,13 +369,13 @@
// Microsoft extensions which should be disabled in strict conformance mode
KEYWORD(__ptr64 , KEYMS)
KEYWORD(__w64 , KEYMS)
-KEYWORD(__uuidof , KEYMS)
+KEYWORD(__uuidof , KEYMS | KEYBORLAND)
ALIAS("_asm" , asm , KEYMS)
-ALIAS("_cdecl" , __cdecl , KEYMS)
-ALIAS("_fastcall" , __fastcall , KEYMS)
-ALIAS("_stdcall" , __stdcall , KEYMS)
+ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND)
+ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND)
+ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND)
ALIAS("_thiscall" , __thiscall , KEYMS)
-ALIAS("_uuidof" ,__uuidof , KEYMS)
+ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND)
// Borland Extensions which should be disabled in strict conformance mode.
ALIAS("_pascal" , __pascal , KEYBORLAND)
Modified: cfe/trunk/test/SemaCXX/borland-extensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/borland-extensions.cpp?rev=113434&r1=113433&r2=113434&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/borland-extensions.cpp (original)
+++ cfe/trunk/test/SemaCXX/borland-extensions.cpp Wed Sep 8 17:56:24 2010
@@ -24,3 +24,30 @@
i = h2<int>(&M::addP);
f = h2(&M::subtractP);
}
+
+// 3. test other calling conventions
+int _cdecl fa3();
+int _fastcall fc3();
+int _stdcall fd3();
+
+// 4. test __uuidof()
+typedef struct _GUID {
+ unsigned long Data1;
+ unsigned short Data2;
+ unsigned short Data3;
+ unsigned char Data4[ 8 ];
+} GUID;
+
+struct __declspec(uuid("{12345678-1234-1234-1234-123456789abc}")) Foo;
+struct Data {
+ GUID const* Guid;
+};
+
+void t4() {
+ unsigned long data;
+
+ const GUID guid_inl = __uuidof(Foo);
+ Data ata1 = { &guid_inl};
+ data = ata1.Guid->Data1;
+}
+
More information about the cfe-commits
mailing list