Here is a quick question on analyzing LLVM IR. So basically I am trying to fetch the return value of the LLVM IR function call statement, something like this:
%47 = call i256 @test(i256 %46)
I want to get access %47
.
And this is the code I have been using to access the parameter.
else if (funcName.contains("test")) {
Value *op = CI->getOperand(0);
if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(op))
// get the first function parameter
op = GEP->getPointerOperand();
}
The very suprising finding is that I just cannot find something like "get return value" or so in the document: http://llvm.org/doxygen/classllvm_1_1CallInst.html
Could anyone shed some lights here? Thanks a lot.
CallInst
no longer exists). Or an instruction that will evaluate to the return value? That's just theCallInst
itself. – LymphValue
instance of the variable%47
. – OvercautiousCallInst
. – Lymph