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/MIRPrinter.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/MIRPrinter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index bdacfb9b4cd..84cf09f904c 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -72,7 +72,8 @@ public: void convert(yaml::MachineFunction &MF, const MachineRegisterInfo &RegInfo, const TargetRegisterInfo *TRI); - void convert(yaml::MachineFrameInfo &YamlMFI, const MachineFrameInfo &MFI); + void convert(ModuleSlotTracker &MST, yaml::MachineFrameInfo &YamlMFI, + const MachineFrameInfo &MFI); void convert(yaml::MachineFunction &MF, const MachineConstantPool &ConstantPool); void convert(ModuleSlotTracker &MST, yaml::MachineJumpTable &YamlJTI, @@ -158,14 +159,13 @@ void MIRPrinter::print(const MachineFunction &MF) { YamlMF.ExposesReturnsTwice = MF.exposesReturnsTwice(); YamlMF.HasInlineAsm = MF.hasInlineAsm(); convert(YamlMF, MF.getRegInfo(), MF.getSubtarget().getRegisterInfo()); - convert(YamlMF.FrameInfo, *MF.getFrameInfo()); + ModuleSlotTracker MST(MF.getFunction()->getParent()); + MST.incorporateFunction(*MF.getFunction()); + convert(MST, YamlMF.FrameInfo, *MF.getFrameInfo()); convertStackObjects(YamlMF, *MF.getFrameInfo(), MF.getSubtarget().getRegisterInfo()); if (const auto *ConstantPool = MF.getConstantPool()) convert(YamlMF, *ConstantPool); - - ModuleSlotTracker MST(MF.getFunction()->getParent()); - MST.incorporateFunction(*MF.getFunction()); if (const auto *JumpTableInfo = MF.getJumpTableInfo()) convert(MST, YamlMF.JumpTableInfo, *JumpTableInfo); for (const auto &MBB : MF) { @@ -207,7 +207,8 @@ void MIRPrinter::convert(yaml::MachineFunction &MF, } } -void MIRPrinter::convert(yaml::MachineFrameInfo &YamlMFI, +void MIRPrinter::convert(ModuleSlotTracker &MST, + yaml::MachineFrameInfo &YamlMFI, const MachineFrameInfo &MFI) { YamlMFI.IsFrameAddressTaken = MFI.isFrameAddressTaken(); YamlMFI.IsReturnAddressTaken = MFI.isReturnAddressTaken(); @@ -222,6 +223,16 @@ void MIRPrinter::convert(yaml::MachineFrameInfo &YamlMFI, YamlMFI.HasOpaqueSPAdjustment = MFI.hasOpaqueSPAdjustment(); YamlMFI.HasVAStart = MFI.hasVAStart(); YamlMFI.HasMustTailInVarArgFunc = MFI.hasMustTailInVarArgFunc(); + if (MFI.getSavePoint()) { + raw_string_ostream StrOS(YamlMFI.SavePoint.Value); + MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping) + .printMBBReference(*MFI.getSavePoint()); + } + if (MFI.getRestorePoint()) { + raw_string_ostream StrOS(YamlMFI.RestorePoint.Value); + MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping) + .printMBBReference(*MFI.getRestorePoint()); + } } void MIRPrinter::convertStackObjects(yaml::MachineFunction &MF, |