[llvm-commits] [llvm] r98862 - /llvm/trunk/lib/Target/X86/X86FastISel.cpp

Eric Christopher echristo at apple.com
Thu Mar 18 13:27:26 PDT 2010


Author: echristo
Date: Thu Mar 18 15:27:26 2010
New Revision: 98862

URL: http://llvm.org/viewvc/llvm-project?rev=98862&view=rev
Log:
Make fast-isel understand llvm.stackprotector.

Modified:
    llvm/trunk/lib/Target/X86/X86FastISel.cpp

Modified: llvm/trunk/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=98862&r1=98861&r2=98862&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FastISel.cpp Thu Mar 18 15:27:26 2010
@@ -1166,6 +1166,21 @@
   // 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();





More information about the llvm-commits mailing list