diff options
author | Alex Lorenz <arphaman@gmail.com> | 2015-07-13 18:07:26 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2015-07-13 18:07:26 +0000 |
commit | de491f05154cfd4ffcd067a091ed542dd42cf829 (patch) | |
tree | 3dfb5c699008ca845d0a864f90644ceffc0129fd /llvm/lib/CodeGen/MIRParser | |
parent | 5f4dd92209f599dfd20569e36c5d649417e6df65 (diff) | |
download | bcm5719-llvm-de491f05154cfd4ffcd067a091ed542dd42cf829.tar.gz bcm5719-llvm-de491f05154cfd4ffcd067a091ed542dd42cf829.zip |
MIR Serialization: Serialize the fixed stack objects.
This commit serializes the fixed stack objects, including fixed spill slots.
The fixed stack objects are serialized using a YAML sequence of YAML inline
mappings. Each mapping has the object's ID, type, size, offset, and alignment.
The objects that aren't spill slots also serialize the isImmutable and isAliased
flags.
The fixed stack objects are a part of the machine function's YAML mapping.
Reviewers: Duncan P. N. Exon Smith
llvm-svn: 242045
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 612084c0b8d..ab4a037aba2 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -376,7 +376,20 @@ bool MIRParserImpl::initializeFrameInfo(MachineFrameInfo &MFI, MFI.setHasVAStart(YamlMFI.HasVAStart); MFI.setHasMustTailInVarArgFunc(YamlMFI.HasMustTailInVarArgFunc); - // Initialize the frame objects. + // Initialize the fixed frame objects. + for (const auto &Object : YamlMF.FixedStackObjects) { + int ObjectIdx; + if (Object.Type != yaml::FixedMachineStackObject::SpillSlot) + ObjectIdx = MFI.CreateFixedObject(Object.Size, Object.Offset, + Object.IsImmutable, Object.IsAliased); + else + ObjectIdx = MFI.CreateFixedSpillStackObject(Object.Size, Object.Offset); + MFI.setObjectAlignment(ObjectIdx, Object.Alignment); + // TODO: Store the mapping between fixed object IDs and object indices to + // parse fixed stack object references correctly. + } + + // Initialize the ordinary frame objects. for (const auto &Object : YamlMF.StackObjects) { int ObjectIdx = MFI.CreateStackObject( Object.Size, Object.Alignment, |