mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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:
@@ -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")) {
|
||||
|
Reference in New Issue
Block a user