MIR Serialization: Serialize the variable sized stack objects.
[oota-llvm.git] / lib / CodeGen / MIRParser / MIRParser.cpp
index ab4a037aba203a31e5924fc1967545f0531afebf..bfec6c59164ffa6a8dcc0d705dfcba2493f0ece1 100644 (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.