llvm.org GIT mirror llvm / 6bfa8a1
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 Evan Cheng 11 years ago
3 changed file(s) with 17 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
3131 string Predicate = predicate;
3232 }
3333
34 /// CCIfStruct - If the current argument is a struct, apply
34 /// CCIfByVal - If the current argument has ByVal parameter attribute, apply
3535 /// Action A.
36 class CCIfStruct : CCIf<"ArgFlags & ISD::ParamFlags::ByVal", A> {
36 class CCIfByVal : CCIf<"ArgFlags & ISD::ParamFlags::ByVal", A> {
3737 }
3838
3939 /// CCIfCC - Match of the current calling convention is 'CC'.
6767 int Align = align;
6868 }
6969
70 /// CCStructAssign - This action always matches: it will use the C ABI and
71 /// the register availability to decided whether to assign to a set of
72 /// registers or to a stack slot.
73 class CCStructAssign regList> : CCAction {
74 list RegList = regList;
70 /// CCPassByVal - This action always matches: it assigns the value to a stack
71 /// slot to implement ByVal aggregate parameter passing. Size and alignment
72 /// specify the minimum size and alignment for the stack slot.
73 class CCPassByVal : CCAction {
74 int Size = size;
75 int Align = align;
7576 }
7677
7778 /// CCPromoteToType - If applied, this promotes the specified current value to
9696
9797 def CC_X86_64_C : CallingConv<[
9898 // Handles byval parameters.
99 CCIfStruct>>,
99 CCIfByVal>>,
100100
101101 // Promote i8/i16 arguments to i32.
102102 CCIfType<[i8, i16], CCPromoteToType>,
135135 // namely R9
136136 def CC_X86_64_TailCall : CallingConv<[
137137 // Handles byval parameters.
138 CCIfStruct>>,
138 CCIfByVal>>,
139139
140140 // Promote i8/i16 arguments to i32.
141141 CCIfType<[i8, i16], CCPromoteToType>,
176176 /// regs.
177177 def CC_X86_32_Common : CallingConv<[
178178 // Handles byval parameters.
179 CCIfStruct>>,
179 CCIfByVal>>,
180180
181181 // Integer/Float values get stored in stack slots that are 4 bytes in
182182 // size and 4-byte aligned.
139139 << IndentStr << IndentStr << "LocInfo = CCValAssign::ZExt;\n"
140140 << IndentStr << "else\n"
141141 << IndentStr << IndentStr << "LocInfo = CCValAssign::AExt;\n";
142 } else if (Action->isSubClassOf("CCStructAssign")) {
143 O << IndentStr <<
144 "State.HandleStruct(ValNo, ValVT, LocVT, LocInfo, ArgFlags);\n";
142 } else if (Action->isSubClassOf("CCPassByVal")) {
143 int Size = Action->getValueAsInt("Size");
144 int Align = Action->getValueAsInt("Align");
145 O << IndentStr
146 << "State.HandleByVal(ValNo, ValVT, LocVT, LocInfo, "
147 << Size << ", " << Align << ", ArgFlags);\n";
145148 O << IndentStr << "return false;\n";
146149 } else {
147150 Action->dump();