diff options
author | Alex Lorenz <arphaman@gmail.com> | 2015-07-29 21:09:09 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2015-07-29 21:09:09 +0000 |
commit | a6f9a37d92bbecaec799e02f84d6bf2cb866e91b (patch) | |
tree | 3fa1f0939fa8b91a98f9f014bccbf7aacca64f02 /llvm/lib/CodeGen/MIRParser/MIRParser.cpp | |
parent | ff16b9ac90dc92ebb2b3097707148930abeca2f8 (diff) | |
download | bcm5719-llvm-a6f9a37d92bbecaec799e02f84d6bf2cb866e91b.tar.gz bcm5719-llvm-a6f9a37d92bbecaec799e02f84d6bf2cb866e91b.zip |
MIR Serialization: Serialize the frame info's save and restore points.
This commit serializes the save and restore machine basic block references from
the machine frame information class.
llvm-svn: 243575
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIRParser.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 1f433e03d1f..d49085b6fe5 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -282,8 +282,6 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) { PerFunctionMIParsingState PFS; if (initializeRegisterInfo(MF, YamlMF, PFS)) return true; - if (initializeFrameInfo(MF, YamlMF, PFS)) - return true; if (!YamlMF.Constants.empty()) { auto *ConstantPool = MF.getConstantPool(); assert(ConstantPool && "Constant pool must be created"); @@ -324,6 +322,10 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) { if (YamlMF.BasicBlocks.empty()) return error(Twine("machine function '") + Twine(MF.getName()) + "' requires at least one machine basic block in its body"); + // Initialize the frame information after creating all the MBBs so that the + // MBB references in the frame information can be resolved. + if (initializeFrameInfo(MF, YamlMF, PFS)) + return true; // Initialize the jump table after creating all the MBBs so that the MBB // references can be resolved. if (!YamlMF.JumpTableInfo.Entries.empty() && @@ -450,6 +452,18 @@ bool MIRParserImpl::initializeFrameInfo(MachineFunction &MF, MFI.setHasOpaqueSPAdjustment(YamlMFI.HasOpaqueSPAdjustment); MFI.setHasVAStart(YamlMFI.HasVAStart); MFI.setHasMustTailInVarArgFunc(YamlMFI.HasMustTailInVarArgFunc); + if (!YamlMFI.SavePoint.Value.empty()) { + MachineBasicBlock *MBB = nullptr; + if (parseMBBReference(MBB, YamlMFI.SavePoint, MF, PFS)) + return true; + MFI.setSavePoint(MBB); + } + if (!YamlMFI.RestorePoint.Value.empty()) { + MachineBasicBlock *MBB = nullptr; + if (parseMBBReference(MBB, YamlMFI.RestorePoint, MF, PFS)) + return true; + MFI.setRestorePoint(MBB); + } std::vector<CalleeSavedInfo> CSIInfo; // Initialize the fixed frame objects. |