diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/PrologEpilogInserter.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/StackProtector.cpp | 4 |
3 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/PrologEpilogInserter.cpp b/lib/CodeGen/PrologEpilogInserter.cpp index e118dd2449..64529372c4 100644 --- a/lib/CodeGen/PrologEpilogInserter.cpp +++ b/lib/CodeGen/PrologEpilogInserter.cpp @@ -408,7 +408,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) { // Make sure that the stack protector comes before the local variables on the // stack. - if (FFI->hasStackProtector()) { + if (FFI->getStackProtectorIndex() >= 0) { int FI = FFI->getStackProtectorIndex(); // If stack grows down, we need to add size of find the lowest diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 267ae36908..a0c30ff6c7 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -3795,7 +3795,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { DAG.setRoot(DAG.getNode(ISD::STACKRESTORE, MVT::Other, getRoot(), Tmp)); return 0; } - case Intrinsic::stackprotector_prologue: { + case Intrinsic::stackprotector_create: { // Emit code into the DAG to store the stack guard onto the stack. MachineFunction &MF = DAG.getMachineFunction(); MachineFrameInfo *MFI = MF.getFrameInfo(); @@ -3809,8 +3809,6 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { unsigned Align = TLI.getTargetData()->getPrefTypeAlignment(PtrTy.getTypeForMVT()); int FI = MFI->CreateStackObject(PtrTy.getSizeInBits() / 8, Align); - - MFI->setStackProtector(true); MFI->setStackProtectorIndex(FI); SDValue FIN = DAG.getFrameIndex(FI, PtrTy); @@ -3823,7 +3821,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { DAG.setRoot(Result); return 0; } - case Intrinsic::stackprotector_epilogue: { + case Intrinsic::stackprotector_check: { // Emit code into the DAG to retrieve the stack guard off of the stack. MachineFunction &MF = DAG.getMachineFunction(); MachineFrameInfo *MFI = MF.getFrameInfo(); diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp index eaf52f691c..318be93b40 100644 --- a/lib/CodeGen/StackProtector.cpp +++ b/lib/CodeGen/StackProtector.cpp @@ -118,7 +118,7 @@ bool StackProtector::InsertStackProtectors() { Constant *StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", GuardTy); LoadInst *LI = new LoadInst(StackGuardVar, "StackGuard", false, InsertPt); CallInst:: - Create(Intrinsic::getDeclaration(M, Intrinsic::stackprotector_prologue), + Create(Intrinsic::getDeclaration(M, Intrinsic::stackprotector_create), LI, "", InsertPt); // Create the basic block to jump to when the guard check fails. @@ -163,7 +163,7 @@ bool StackProtector::InsertStackProtectors() { // Generate the stack protector instructions in the old basic block. LoadInst *LI1 = new LoadInst(StackGuardVar, "", false, BB); CallInst *CI = CallInst:: - Create(Intrinsic::getDeclaration(M, Intrinsic::stackprotector_epilogue), + Create(Intrinsic::getDeclaration(M, Intrinsic::stackprotector_check), "", BB); ICmpInst *Cmp = new ICmpInst(CmpInst::ICMP_EQ, CI, LI1, "", BB); BranchInst::Create(NewBB, FailBB, Cmp, BB); |