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 | 52ecfdf3c5c9fac6b0262b8a09bfdd6335ceacf0 (patch) | |
| tree | 78e6f479086bdc7847151db2fab2025baf4703da /llvm/lib | |
| parent | a7f236ae3a4ae9c5d42ddb9f4a94b40d533f0536 (diff) | |
| download | bcm5719-llvm-52ecfdf3c5c9fac6b0262b8a09bfdd6335ceacf0.tar.gz bcm5719-llvm-52ecfdf3c5c9fac6b0262b8a09bfdd6335ceacf0.zip | |
Make fast-isel understand llvm.stackprotector.
llvm-svn: 98862
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86FastISel.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp index 96b652d39e0..4a39bd51672 100644 --- a/llvm/lib/Target/X86/X86FastISel.cpp +++ b/llvm/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(); |

