diff options
author | Duncan Sands <baldrick@free.fr> | 2007-11-14 08:29:13 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-11-14 08:29:13 +0000 |
commit | 87b665d3dee92ef5f30d9eb1afdb64448bc3e2ef (patch) | |
tree | 521936bd9b55ee796e8d3e92ca991adbe3796471 /utils/TableGen/CallingConvEmitter.cpp | |
parent | 38afd9e3ac3f6b47a45528e708e800730dbbfd2d (diff) | |
download | external_llvm-87b665d3dee92ef5f30d9eb1afdb64448bc3e2ef.zip external_llvm-87b665d3dee92ef5f30d9eb1afdb64448bc3e2ef.tar.gz external_llvm-87b665d3dee92ef5f30d9eb1afdb64448bc3e2ef.tar.bz2 |
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
Diffstat (limited to 'utils/TableGen/CallingConvEmitter.cpp')
-rw-r--r-- | utils/TableGen/CallingConvEmitter.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/utils/TableGen/CallingConvEmitter.cpp b/utils/TableGen/CallingConvEmitter.cpp index 79e3a9c..82013c9 100644 --- a/utils/TableGen/CallingConvEmitter.cpp +++ b/utils/TableGen/CallingConvEmitter.cpp @@ -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")) { |