summaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-27 05:57:32 +0000
committerChris Lattner <sabre@nondot.org>2007-02-27 05:57:32 +0000
commit00836648aed191e70a569caad4294d82b6bb5b0d (patch)
tree1650d5a9333669f09d7079a78c48b6446b41cbcc /lib/Target
parentd50110d8dce25cb802f3a80e0bc0bb3ff2ccbfb0 (diff)
downloadllvm-00836648aed191e70a569caad4294d82b6bb5b0d.tar.gz
llvm-00836648aed191e70a569caad4294d82b6bb5b0d.tar.bz2
llvm-00836648aed191e70a569caad4294d82b6bb5b0d.tar.xz
move target independent calling convention stuff to TargetCallingConv.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/TargetCallingConv.td71
-rw-r--r--lib/Target/X86/X86CallingConv.td56
2 files changed, 71 insertions, 56 deletions
diff --git a/lib/Target/TargetCallingConv.td b/lib/Target/TargetCallingConv.td
new file mode 100644
index 0000000000..3dcd7458f8
--- /dev/null
+++ b/lib/Target/TargetCallingConv.td
@@ -0,0 +1,71 @@
+//===- TargetCallingConv.td - Target Calling Conventions ---*- tablegen -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the target-independent interfaces with which targets
+// describe their calling conventions.
+//
+//===----------------------------------------------------------------------===//
+
+class CCAction;
+class CallingConv;
+
+/// CCPredicateAction - Instances of this class check some predicate, then
+/// delegate to another action if the predicate is true.
+class CCPredicateAction<CCAction A> : CCAction {
+ CCAction SubAction = A;
+}
+
+/// CCMatchType - If the current argument is one of the specified types, apply
+/// Action A.
+class CCMatchType<list<ValueType> VTs, CCAction A> : CCPredicateAction<A> {
+}
+
+/// CCMatchIf - If the predicate matches, apply A.
+class CCMatchIf<string predicate, CCAction A> : CCPredicateAction<A> {
+ string Predicate = predicate;
+}
+
+/// CCMatchIfCC - Match of the current calling convention is 'CC'.
+class CCMatchIfCC<string CC, CCAction A> : CCPredicateAction<A> {
+ string CallingConv = CC;
+}
+
+/// CCAssignToReg - This action matches if there is a register in the specified
+/// list that is still available. If so, it assigns the value to the first
+/// available register and succeeds.
+class CCAssignToReg<list<Register> regList> : CCAction {
+ list<Register> RegList = regList;
+}
+
+/// CCAssignToStack - This action always matches: it assigns the value to a
+/// stack slot of the specified size and alignment on the stack.
+class CCAssignToStack<int size, int align> : CCAction {
+ int Size = size;
+ int Align = align;
+}
+
+
+/// CCPromoteToType - If applied, this promotes the specified current value to
+/// the specified type.
+class CCPromoteToType<ValueType destTy> : CCAction {
+ ValueType DestTy = destTy;
+}
+
+/// CCDelegateTo - This action invokes the specified sub-calling-convention. It
+/// is successful if the specified CC matches.
+class CCDelegateTo<CallingConv cc> : CCAction {
+ CallingConv CC = cc;
+}
+
+/// CallingConv - An instance of this is used to define each calling convention
+/// that the target supports.
+class CallingConv<list<CCAction> actions> {
+ list<CCAction> Actions = actions;
+}
+
diff --git a/lib/Target/X86/X86CallingConv.td b/lib/Target/X86/X86CallingConv.td
index 110335b8c1..635c729c9d 100644
--- a/lib/Target/X86/X86CallingConv.td
+++ b/lib/Target/X86/X86CallingConv.td
@@ -12,62 +12,6 @@
//
//===----------------------------------------------------------------------===//
-class CCAction;
-class CallingConv;
-
-/// CCPredicateAction - Instances of this class check some predicate, then
-/// delegate to another action if the predicate is true.
-class CCPredicateAction<CCAction A> : CCAction {
- CCAction SubAction = A;
-}
-
-/// CCMatchType - If the current argument is one of the specified types, apply
-/// Action A.
-class CCMatchType<list<ValueType> VTs, CCAction A> : CCPredicateAction<A> {
-}
-
-/// CCMatchIf - If the predicate matches, apply A.
-class CCMatchIf<string predicate, CCAction A> : CCPredicateAction<A> {
- string Predicate = predicate;
-}
-
-/// CCMatchIfCC - Match of the current calling convention is 'CC'.
-class CCMatchIfCC<string CC, CCAction A> : CCPredicateAction<A> {
- string CallingConv = CC;
-}
-
-/// CCAssignToReg - This action matches if there is a register in the specified
-/// list that is still available. If so, it assigns the value to the first
-/// available register and succeeds.
-class CCAssignToReg<list<Register> regList> : CCAction {
- list<Register> RegList = regList;
-}
-
-/// CCAssignToStack - This action always matches: it assigns the value to a
-/// stack slot of the specified size and alignment on the stack.
-class CCAssignToStack<int size, int align> : CCAction {
- int Size = size;
- int Align = align;
-}
-
-
-/// CCPromoteToType - If applied, this promotes the specified current value to
-/// the specified type.
-class CCPromoteToType<ValueType destTy> : CCAction {
- ValueType DestTy = destTy;
-}
-
-/// CCDelegateTo - This action invokes the specified sub-calling-convention. It
-/// is successful if the specified CC matches.
-class CCDelegateTo<CallingConv cc> : CCAction {
- CallingConv CC = cc;
-}
-
-
-class CallingConv<list<CCAction> actions> {
- list<CCAction> Actions = actions;
-}
-
//===----------------------------------------------------------------------===//
// Return Value Calling Conventions
//===----------------------------------------------------------------------===//