MIR Serialization: Serialize the variable sized stack objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242095 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alex Lorenz
2015-07-14 00:26:26 +00:00
parent b53f724f91
commit dee03ee0f9
6 changed files with 101 additions and 7 deletions

View File

@ -391,9 +391,14 @@ bool MIRParserImpl::initializeFrameInfo(MachineFrameInfo &MFI,
// Initialize the ordinary frame objects.
for (const auto &Object : YamlMF.StackObjects) {
int ObjectIdx = MFI.CreateStackObject(
Object.Size, Object.Alignment,
Object.Type == yaml::MachineStackObject::SpillSlot);
int ObjectIdx;
if (Object.Type == yaml::MachineStackObject::VariableSized)
ObjectIdx =
MFI.CreateVariableSizedObject(Object.Alignment, /*Alloca=*/nullptr);
else
ObjectIdx = MFI.CreateStackObject(
Object.Size, Object.Alignment,
Object.Type == yaml::MachineStackObject::SpillSlot);
MFI.setObjectOffset(ObjectIdx, Object.Offset);
// TODO: Store the mapping between object IDs and object indices to parse
// stack object references correctly.