1

I have a call instruction 'call void @calculate_output(i32 %14), !dbg !141' in llvm. I want to retrieve the value object %14 from this. Whenever, I am trying, I am getting the formal parameters for this instead of the actual parameter.

1 Answer 1

3

If you are getting formal parameters, it means you are working with Function*, not CallInst*. Did you call call->getFunction()?

What you need is just call->getArgOperand(0), see https://llvm.org/doxygen/classllvm_1_1CallBase.html#ab2caa29167597390ab2fc3cf30d70389

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.