aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorDawn Perchik <dawn@burble.org>2010-09-03 01:29:35 +0000
committerDawn Perchik <dawn@burble.org>2010-09-03 01:29:35 +0000
commit52fc314e1b5e1baee6305067cf831763d02bd243 (patch)
treee6522fa435073d32631e8de16eb6d3e2e05df117 /lib/Sema
parent47a88fa2efdaf40449b7e7e28252c7c6f410b37f (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 'lib/Sema')
-rw-r--r--lib/Sema/AttributeList.cpp2
-rw-r--r--lib/Sema/SemaDeclAttr.cpp4
-rw-r--r--lib/Sema/SemaType.cpp2
3 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/AttributeList.cpp b/lib/Sema/AttributeList.cpp
index 3f34aa67ae..8ccb2ca586 100644
--- a/lib/Sema/AttributeList.cpp
+++ b/lib/Sema/AttributeList.cpp
@@ -126,9 +126,11 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
.Case("init_priority", AT_init_priority)
.Case("no_instrument_function", AT_no_instrument_function)
.Case("thiscall", AT_thiscall)
+ .Case("pascal", AT_pascal)
.Case("__cdecl", AT_cdecl)
.Case("__stdcall", AT_stdcall)
.Case("__fastcall", AT_fastcall)
.Case("__thiscall", AT_thiscall)
+ .Case("__pascal", AT_pascal)
.Default(UnknownAttribute);
}
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index f987067a31..25af73ae13 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1986,6 +1986,9 @@ static void HandleCallConvAttr(Decl *d, const AttributeList &Attr, Sema &S) {
case AttributeList::AT_cdecl:
d->addAttr(::new (S.Context) CDeclAttr(Attr.getLoc(), S.Context));
return;
+ case AttributeList::AT_pascal:
+ d->addAttr(::new (S.Context) PascalAttr(Attr.getLoc(), S.Context));
+ return;
default:
llvm_unreachable("unexpected attribute kind");
return;
@@ -2294,6 +2297,7 @@ static void ProcessDeclAttribute(Scope *scope, Decl *D,
case AttributeList::AT_cdecl:
case AttributeList::AT_fastcall:
case AttributeList::AT_thiscall:
+ case AttributeList::AT_pascal:
HandleCallConvAttr(D, Attr, S);
break;
default:
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 92439ff0da..aa30b5c2da 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1901,6 +1901,7 @@ bool ProcessFnAttr(Sema &S, QualType &Type, const AttributeList &Attr) {
case AttributeList::AT_fastcall: CC = CC_X86FastCall; break;
case AttributeList::AT_stdcall: CC = CC_X86StdCall; break;
case AttributeList::AT_thiscall: CC = CC_X86ThisCall; break;
+ case AttributeList::AT_pascal: CC = CC_X86Pascal; break;
default: llvm_unreachable("unexpected attribute kind"); return false;
}
@@ -2028,6 +2029,7 @@ void ProcessTypeAttributeList(Sema &S, QualType &Result,
case AttributeList::AT_fastcall:
case AttributeList::AT_stdcall:
case AttributeList::AT_thiscall:
+ case AttributeList::AT_pascal:
case AttributeList::AT_regparm:
// Don't process these on the DeclSpec.
if (IsDeclSpec ||