diff options
author | Eric Christopher <echristo@apple.com> | 2010-03-18 20:27:26 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-03-18 20:27:26 +0000 |
commit | 07754c2a1b06b5d027cf4cdf532e25f4e8055058 (patch) | |
tree | 53ea24ae5f6ace3b037019b23c884863323e60cd | |
parent | 95808328b4d92e9e5398fe7b38079dcf4ecf1232 (diff) |
Make fast-isel understand llvm.stackprotector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98862 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86FastISel.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index 96b652d39e..4a39bd5167 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -1166,6 +1166,21 @@ bool X86FastISel::X86VisitIntrinsicCall(IntrinsicInst &I) { // FIXME: Handle more intrinsics. switch (I.getIntrinsicID()) { default: return false; + case Intrinsic::stackprotector: { + // Emit code inline code to store the stack guard onto the stack. + EVT PtrTy = TLI.getPointerTy(); + + Value *Op1 = I.getOperand(1); // The guard's value. + AllocaInst *Slot = cast<AllocaInst>(I.getOperand(2)); + + // Grab the frame index. + X86AddressMode AM; + if (!X86SelectAddress(Slot, AM)) return false; + + X86FastEmitStore(PtrTy, Op1, AM); + UpdateValueMap(&I, getRegForValue(Op1)); + return true; + } case Intrinsic::objectsize: { ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(2)); const Type *Ty = I.getCalledFunction()->getReturnType(); |