mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Make fast-isel understand llvm.stackprotector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1166,6 +1166,21 @@ bool X86FastISel::X86VisitIntrinsicCall(IntrinsicInst &I) {
|
|||||||
// FIXME: Handle more intrinsics.
|
// FIXME: Handle more intrinsics.
|
||||||
switch (I.getIntrinsicID()) {
|
switch (I.getIntrinsicID()) {
|
||||||
default: return false;
|
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: {
|
case Intrinsic::objectsize: {
|
||||||
ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(2));
|
ConstantInt *CI = dyn_cast<ConstantInt>(I.getOperand(2));
|
||||||
const Type *Ty = I.getCalledFunction()->getReturnType();
|
const Type *Ty = I.getCalledFunction()->getReturnType();
|
||||||
|
Reference in New Issue
Block a user