From db2049fb8ea750b3714e31ccd913e50e20b8f25e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 27 Feb 2007 05:57:32 +0000 Subject: [PATCH] move target independent calling convention stuff to TargetCallingConv.td llvm-svn: 34659 --- llvm/lib/Target/TargetCallingConv.td | 71 +++++++++++++++++++++++++++ llvm/lib/Target/X86/X86CallingConv.td | 56 --------------------- 2 files changed, 71 insertions(+), 56 deletions(-) create mode 100644 llvm/lib/Target/TargetCallingConv.td diff --git a/llvm/lib/Target/TargetCallingConv.td b/llvm/lib/Target/TargetCallingConv.td new file mode 100644 index 000000000000..3dcd7458f834 --- /dev/null +++ b/llvm/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 { + CCAction SubAction = A; +} + +/// CCMatchType - If the current argument is one of the specified types, apply +/// Action A. +class CCMatchType VTs, CCAction A> : CCPredicateAction { +} + +/// CCMatchIf - If the predicate matches, apply A. +class CCMatchIf : CCPredicateAction { + string Predicate = predicate; +} + +/// CCMatchIfCC - Match of the current calling convention is 'CC'. +class CCMatchIfCC : CCPredicateAction { + 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 regList> : CCAction { + list 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 : CCAction { + int Size = size; + int Align = align; +} + + +/// CCPromoteToType - If applied, this promotes the specified current value to +/// the specified type. +class CCPromoteToType : CCAction { + ValueType DestTy = destTy; +} + +/// CCDelegateTo - This action invokes the specified sub-calling-convention. It +/// is successful if the specified CC matches. +class CCDelegateTo : CCAction { + CallingConv CC = cc; +} + +/// CallingConv - An instance of this is used to define each calling convention +/// that the target supports. +class CallingConv actions> { + list Actions = actions; +} + diff --git a/llvm/lib/Target/X86/X86CallingConv.td b/llvm/lib/Target/X86/X86CallingConv.td index 110335b8c109..635c729c9d8b 100644 --- a/llvm/lib/Target/X86/X86CallingConv.td +++ b/llvm/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 { - CCAction SubAction = A; -} - -/// CCMatchType - If the current argument is one of the specified types, apply -/// Action A. -class CCMatchType VTs, CCAction A> : CCPredicateAction { -} - -/// CCMatchIf - If the predicate matches, apply A. -class CCMatchIf : CCPredicateAction { - string Predicate = predicate; -} - -/// CCMatchIfCC - Match of the current calling convention is 'CC'. -class CCMatchIfCC : CCPredicateAction { - 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 regList> : CCAction { - list 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 : CCAction { - int Size = size; - int Align = align; -} - - -/// CCPromoteToType - If applied, this promotes the specified current value to -/// the specified type. -class CCPromoteToType : CCAction { - ValueType DestTy = destTy; -} - -/// CCDelegateTo - This action invokes the specified sub-calling-convention. It -/// is successful if the specified CC matches. -class CCDelegateTo : CCAction { - CallingConv CC = cc; -} - - -class CallingConv actions> { - list Actions = actions; -} - //===----------------------------------------------------------------------===// // Return Value Calling Conventions //===----------------------------------------------------------------------===// -- GitLab