diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-11-07 01:23:58 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-11-07 01:23:58 +0000 |
commit | eb4268d72fa08d7e35c1efdb833a5e0469f2a420 (patch) | |
tree | 288a7111e9aa460a09ae29b57cbdb8dc576a1e79 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | 87d0746e7142fd1a4b748019f8fe906510dec9df (diff) | |
download | bcm5719-llvm-eb4268d72fa08d7e35c1efdb833a5e0469f2a420.tar.gz bcm5719-llvm-eb4268d72fa08d7e35c1efdb833a5e0469f2a420.zip |
- Modify the stack protector algorithm so that the stack slot is allocated in
LLVM IR code and not in the selection DAG ISel. This is a cleaner solution.
- Fix the heuristic for determining if protectors are necessary. The previous
one wasn't checking the proper type size.
llvm-svn: 58824
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index a0c30ff6c75..3e19b71b3bb 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -3801,14 +3801,10 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { MachineFrameInfo *MFI = MF.getFrameInfo(); MVT PtrTy = TLI.getPointerTy(); - // Retrieve the stack protector guard's value. - SDValue Src = getValue(I.getOperand(1)); - - // Create a slot on the stack for the stack protector. It should go first - // before local variables are allocated. - unsigned Align = - TLI.getTargetData()->getPrefTypeAlignment(PtrTy.getTypeForMVT()); - int FI = MFI->CreateStackObject(PtrTy.getSizeInBits() / 8, Align); + SDValue Src = getValue(I.getOperand(1)); // The guard's value. + AllocaInst *Slot = cast<AllocaInst>(I.getOperand(2)); + + int FI = FuncInfo.StaticAllocaMap[Slot]; MFI->setStackProtectorIndex(FI); SDValue FIN = DAG.getFrameIndex(FI, PtrTy); |