summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRPrinter.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-18 22:26:26 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-18 22:26:26 +0000
commita314d81328bb246646836f8c778a01b3ec4ddb87 (patch)
tree0f8d4f0ac7bc15ba915b8dc945098f03eade0c4e /llvm/lib/CodeGen/MIRPrinter.cpp
parent913f776ff9b1ca1ee8875a9dba7f6e633932b4da (diff)
downloadbcm5719-llvm-a314d81328bb246646836f8c778a01b3ec4ddb87.tar.gz
bcm5719-llvm-a314d81328bb246646836f8c778a01b3ec4ddb87.zip
MIR Serialization: Serialize the frame information's stack protector index.
llvm-svn: 245372
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 57e9d875148..9e3f6bb65f6 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -84,7 +84,7 @@ public:
void convert(ModuleSlotTracker &MST, yaml::MachineJumpTable &YamlJTI,
const MachineJumpTableInfo &JTI);
void convertStackObjects(yaml::MachineFunction &MF,
- const MachineFrameInfo &MFI,
+ const MachineFrameInfo &MFI, ModuleSlotTracker &MST,
const TargetRegisterInfo *TRI);
private:
@@ -171,7 +171,7 @@ void MIRPrinter::print(const MachineFunction &MF) {
ModuleSlotTracker MST(MF.getFunction()->getParent());
MST.incorporateFunction(*MF.getFunction());
convert(MST, YamlMF.FrameInfo, *MF.getFrameInfo());
- convertStackObjects(YamlMF, *MF.getFrameInfo(),
+ convertStackObjects(YamlMF, *MF.getFrameInfo(), MST,
MF.getSubtarget().getRegisterInfo());
if (const auto *ConstantPool = MF.getConstantPool())
convert(YamlMF, *ConstantPool);
@@ -265,6 +265,7 @@ void MIRPrinter::convert(ModuleSlotTracker &MST,
void MIRPrinter::convertStackObjects(yaml::MachineFunction &MF,
const MachineFrameInfo &MFI,
+ ModuleSlotTracker &MST,
const TargetRegisterInfo *TRI) {
// Process fixed stack objects.
unsigned ID = 0;
@@ -333,6 +334,14 @@ void MIRPrinter::convertStackObjects(yaml::MachineFunction &MF,
assert(!StackObject.IsFixed && "Expected a locally mapped stack object");
MF.StackObjects[StackObject.ID].LocalOffset = LocalObject.second;
}
+
+ // Print the stack object references in the frame information class after
+ // converting the stack objects.
+ if (MFI.hasStackProtectorIndex()) {
+ raw_string_ostream StrOS(MF.FrameInfo.StackProtector.Value);
+ MIPrinter(StrOS, MST, RegisterMaskIds, StackObjectOperandMapping)
+ .printStackObjectReference(MFI.getStackProtectorIndex());
+ }
}
void MIRPrinter::convert(yaml::MachineFunction &MF,
OpenPOWER on IntegriCloud