Displaying 1 result from an estimated 1 matches for "setreturnaddr".
2013 Nov 04
0
[LLVMdev] Implementing an llvm.setreturnaddress intrinsic
...ving some trouble implementing a new intrinsic for LLVM and I
was wondering if someone might know the answer.
LLVM has an llvm.returnaddress intrinsic, but for a specific project, I
need to be able to modify the return address of a function as well, so I'm
implementing a new intrinsic:
def int_setreturnaddress : Intrinsic<[], [llvm_i32_ty, llvm_ptr_ty],
[]>;
And I'm using it as follows:
B.CreateCall2(
Intrinsic::getDeclaration(M, Intrinsic::setreturnaddress),
ConstantInt::get(Type::getInt32Ty(RI->getContext()), 0),
B.CreateIntToPtr(ConstantInt::get(IntPtrTy, 0 /* testing */)),...