diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index ab4a037aba2..bfec6c59164 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -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. diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index d9cd136f985..0af2fbd94dd 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -188,7 +188,9 @@ void MIRPrinter::convertStackObjects(yaml::MachineFunction &MF, YamlObject.ID = ID++; YamlObject.Type = MFI.isSpillSlotObjectIndex(I) ? yaml::MachineStackObject::SpillSlot - : yaml::MachineStackObject::DefaultType; + : MFI.isVariableSizedObjectIndex(I) + ? yaml::MachineStackObject::VariableSized + : yaml::MachineStackObject::DefaultType; YamlObject.Offset = MFI.getObjectOffset(I); YamlObject.Size = MFI.getObjectSize(I); YamlObject.Alignment = MFI.getObjectAlignment(I); |