mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-19 13:38:56 +00:00
Rename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove unused parameters of CCStructAssign and add size and alignment requirement info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45997 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bdfd5ef823
commit
6bfa8a121d
@ -32,9 +32,9 @@ class CCIf<string predicate, CCAction A> : CCPredicateAction<A> {
|
|||||||
string Predicate = predicate;
|
string Predicate = predicate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CCIfStruct - If the current argument is a struct, apply
|
/// CCIfByVal - If the current argument has ByVal parameter attribute, apply
|
||||||
/// Action A.
|
/// Action A.
|
||||||
class CCIfStruct<CCAction A> : CCIf<"ArgFlags & ISD::ParamFlags::ByVal", A> {
|
class CCIfByVal<CCAction A> : CCIf<"ArgFlags & ISD::ParamFlags::ByVal", A> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CCIfCC - Match of the current calling convention is 'CC'.
|
/// CCIfCC - Match of the current calling convention is 'CC'.
|
||||||
@ -68,11 +68,12 @@ class CCAssignToStack<int size, int align> : CCAction {
|
|||||||
int Align = align;
|
int Align = align;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CCStructAssign - This action always matches: it will use the C ABI and
|
/// CCPassByVal - This action always matches: it assigns the value to a stack
|
||||||
/// the register availability to decided whether to assign to a set of
|
/// slot to implement ByVal aggregate parameter passing. Size and alignment
|
||||||
/// registers or to a stack slot.
|
/// specify the minimum size and alignment for the stack slot.
|
||||||
class CCStructAssign<list<Register> regList> : CCAction {
|
class CCPassByVal<int size, int align> : CCAction {
|
||||||
list<Register> RegList = regList;
|
int Size = size;
|
||||||
|
int Align = align;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CCPromoteToType - If applied, this promotes the specified current value to
|
/// CCPromoteToType - If applied, this promotes the specified current value to
|
||||||
|
@ -97,7 +97,7 @@ def RetCC_X86 : CallingConv<[
|
|||||||
|
|
||||||
def CC_X86_64_C : CallingConv<[
|
def CC_X86_64_C : CallingConv<[
|
||||||
// Handles byval parameters.
|
// Handles byval parameters.
|
||||||
CCIfStruct<CCStructAssign<[]>>,
|
CCIfByVal<CCPassByVal<8, 8>>,
|
||||||
|
|
||||||
// Promote i8/i16 arguments to i32.
|
// Promote i8/i16 arguments to i32.
|
||||||
CCIfType<[i8, i16], CCPromoteToType<i32>>,
|
CCIfType<[i8, i16], CCPromoteToType<i32>>,
|
||||||
@ -136,7 +136,7 @@ def CC_X86_64_C : CallingConv<[
|
|||||||
// namely R9
|
// namely R9
|
||||||
def CC_X86_64_TailCall : CallingConv<[
|
def CC_X86_64_TailCall : CallingConv<[
|
||||||
// Handles byval parameters.
|
// Handles byval parameters.
|
||||||
CCIfStruct<CCStructAssign<[]>>,
|
CCIfByVal<CCPassByVal<8, 8>>,
|
||||||
|
|
||||||
// Promote i8/i16 arguments to i32.
|
// Promote i8/i16 arguments to i32.
|
||||||
CCIfType<[i8, i16], CCPromoteToType<i32>>,
|
CCIfType<[i8, i16], CCPromoteToType<i32>>,
|
||||||
@ -177,7 +177,7 @@ def CC_X86_64_TailCall : CallingConv<[
|
|||||||
/// regs.
|
/// regs.
|
||||||
def CC_X86_32_Common : CallingConv<[
|
def CC_X86_32_Common : CallingConv<[
|
||||||
// Handles byval parameters.
|
// Handles byval parameters.
|
||||||
CCIfStruct<CCStructAssign<[]>>,
|
CCIfByVal<CCPassByVal<4, 4>>,
|
||||||
|
|
||||||
// Integer/Float values get stored in stack slots that are 4 bytes in
|
// Integer/Float values get stored in stack slots that are 4 bytes in
|
||||||
// size and 4-byte aligned.
|
// size and 4-byte aligned.
|
||||||
|
@ -140,9 +140,12 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
|||||||
<< IndentStr << IndentStr << "LocInfo = CCValAssign::ZExt;\n"
|
<< IndentStr << IndentStr << "LocInfo = CCValAssign::ZExt;\n"
|
||||||
<< IndentStr << "else\n"
|
<< IndentStr << "else\n"
|
||||||
<< IndentStr << IndentStr << "LocInfo = CCValAssign::AExt;\n";
|
<< IndentStr << IndentStr << "LocInfo = CCValAssign::AExt;\n";
|
||||||
} else if (Action->isSubClassOf("CCStructAssign")) {
|
} else if (Action->isSubClassOf("CCPassByVal")) {
|
||||||
O << IndentStr <<
|
int Size = Action->getValueAsInt("Size");
|
||||||
"State.HandleStruct(ValNo, ValVT, LocVT, LocInfo, ArgFlags);\n";
|
int Align = Action->getValueAsInt("Align");
|
||||||
|
O << IndentStr
|
||||||
|
<< "State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, "
|
||||||
|
<< Size << ", " << Align << ", ArgFlags);\n";
|
||||||
O << IndentStr << "return false;\n";
|
O << IndentStr << "return false;\n";
|
||||||
} else {
|
} else {
|
||||||
Action->dump();
|
Action->dump();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user