diff options
author | Dawn Perchik <dawn@burble.org> | 2010-09-03 01:29:35 +0000 |
---|---|---|
committer | Dawn Perchik <dawn@burble.org> | 2010-09-03 01:29:35 +0000 |
commit | 52fc314e1b5e1baee6305067cf831763d02bd243 (patch) | |
tree | e6522fa435073d32631e8de16eb6d3e2e05df117 /include | |
parent | 47a88fa2efdaf40449b7e7e28252c7c6f410b37f (diff) |
Add symantic support for the Pascal calling convention via
"__attribute((pascal))" or "__pascal" (and "_pascal" under
-fborland-extensions). Support still needs to be added to llvm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112939 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/Type.h | 5 | ||||
-rw-r--r-- | include/clang/Basic/Attr.td | 4 | ||||
-rw-r--r-- | include/clang/Basic/TokenKinds.def | 7 | ||||
-rw-r--r-- | include/clang/Parse/Parser.h | 1 | ||||
-rw-r--r-- | include/clang/Sema/AttributeList.h | 1 |
5 files changed, 16 insertions, 2 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 819d7d24a5..92e62a58d4 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -410,7 +410,8 @@ enum CallingConv { CC_C, // __attribute__((cdecl)) CC_X86StdCall, // __attribute__((stdcall)) CC_X86FastCall, // __attribute__((fastcall)) - CC_X86ThisCall // __attribute__((thiscall)) + CC_X86ThisCall, // __attribute__((thiscall)) + CC_X86Pascal // __attribute__((pascal)) }; @@ -1928,7 +1929,7 @@ class FunctionType : public Type { // The value passed to __attribute__((regparm(x))) unsigned RegParm; // The calling convention as specified via - // __attribute__((cdecl|stdcall|fastcall|thiscall)) + // __attribute__((cdecl|stdcall|fastcall|thiscall|pascal)) CallingConv CC; }; diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 12bd5cfdce..2f2267f7f7 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -359,6 +359,10 @@ def ThisCall : Attr { let Spellings = ["thiscall", "__thiscall"]; } +def Pascal : Attr { + let Spellings = ["pascal", "__pascal"]; +} + def TransparentUnion : Attr { let Spellings = ["transparent_union"]; } diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def index 11bcab9839..dc360adf8f 100644 --- a/include/clang/Basic/TokenKinds.def +++ b/include/clang/Basic/TokenKinds.def @@ -186,6 +186,7 @@ PUNCTUATOR(at, "@") // KEYCXX0X - This is a C++ keyword introduced to C++ in C++0x // KEYGNU - This is a keyword if GNU extensions are enabled // KEYMS - This is a keyword if Microsoft extensions are enabled +// KEYBORLAND - This is a keyword if Borland extensions are enabled // KEYWORD(auto , KEYALL) KEYWORD(break , KEYALL) @@ -335,6 +336,9 @@ KEYWORD(__fastcall , KEYALL) KEYWORD(__thiscall , KEYALL) KEYWORD(__forceinline , KEYALL) +// Borland Extension. +KEYWORD(__pascal , KEYALL) + // Altivec Extension. KEYWORD(__vector , KEYALTIVEC) KEYWORD(__pixel , KEYALTIVEC) @@ -371,6 +375,9 @@ ALIAS("_fastcall" , __fastcall , KEYMS) ALIAS("_stdcall" , __stdcall , KEYMS) ALIAS("_thiscall" , __thiscall , KEYMS) +// Borland Extensions which should be disabled in strict conformance mode. +ALIAS("_pascal" , __pascal , KEYBORLAND) + //===----------------------------------------------------------------------===// // Objective-C @-preceeded keywords. //===----------------------------------------------------------------------===// diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index f1c1a5b763..41a2fb6157 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -1365,6 +1365,7 @@ private: AttributeList *ParseGNUAttributes(SourceLocation *EndLoc = 0); AttributeList *ParseMicrosoftDeclSpec(AttributeList* CurrAttr = 0); AttributeList *ParseMicrosoftTypeAttributes(AttributeList* CurrAttr = 0); + AttributeList *ParseBorlandTypeAttributes(AttributeList* CurrAttr = 0); void ParseTypeofSpecifier(DeclSpec &DS); void ParseDecltypeSpecifier(DeclSpec &DS); diff --git a/include/clang/Sema/AttributeList.h b/include/clang/Sema/AttributeList.h index c067b0ccd7..53316477e1 100644 --- a/include/clang/Sema/AttributeList.h +++ b/include/clang/Sema/AttributeList.h @@ -102,6 +102,7 @@ public: AT_ownership_returns, // Clang-specific. AT_ownership_takes, // Clang-specific. AT_packed, + AT_pascal, AT_pure, AT_regparm, AT_section, |