Eliminate the recently introduced CCAssignToStackABISizeAlign

in favour of teaching CCAssignToStack that size 0 and/or align
0 means to use the ABI values.  This seems a neater solution.
It is safe since no legal value type has size 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44107 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands
2007-11-14 08:29:13 +00:00
parent 38afd9e3ac
commit 87b665d3de
3 changed files with 19 additions and 22 deletions

View File

@@ -114,19 +114,21 @@ void CallingConvEmitter::EmitAction(Record *Action,
} else if (Action->isSubClassOf("CCAssignToStack")) {
int Size = Action->getValueAsInt("Size");
int Align = Action->getValueAsInt("Align");
O << IndentStr << "unsigned Offset" << ++Counter
<< " = State.AllocateStack(" << Size << ", " << Align << ");\n";
O << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
<< Counter << ", LocVT, LocInfo));\n";
O << IndentStr << "return false;\n";
} else if (Action->isSubClassOf("CCAssignToStackABISizeAlign")) {
O << IndentStr << "unsigned Offset" << ++Counter
<< " = State.AllocateStack(State.getTarget().getTargetData()"
"->getABITypeSize(MVT::getTypeForValueType(LocVT)),\n";
O << IndentStr << " State.getTarget().getTargetData()"
"->getABITypeAlignment(MVT::getTypeForValueType(LocVT)));\n";
O << IndentStr << "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
<< " = State.AllocateStack(";
if (Size)
O << Size << ", ";
else
O << "\n" << IndentStr << " State.getTarget().getTargetData()"
"->getABITypeSize(MVT::getTypeForValueType(LocVT)), ";
if (Align)
O << Align;
else
O << "\n" << IndentStr << " State.getTarget().getTargetData()"
"->getABITypeAlignment(MVT::getTypeForValueType(LocVT))";
O << ");\n" << IndentStr
<< "State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset"
<< Counter << ", LocVT, LocInfo));\n";
O << IndentStr << "return false;\n";
} else if (Action->isSubClassOf("CCPromoteToType")) {