[LLVMdev] How can I find the LHS of the function call when traversing the function call

Krzysztof Parzyszek kparzysz at codeaurora.org
Mon Oct 8 17:10:45 PDT 2012


On 10/8/2012 6:44 PM, tarique anwer wrote:
>
>   %var2  = call i8 @myfuncCall (i2 %var1)
>
> In after I parse the file (lets say using parseIRFiles ).
> I can see the instructions,( the function call instruction ), How can I
> get the %var2 from the instruction/callInstruction ?
>
> going thru the llvm installations cpp and .h files, it is not clear how
> do I get the desired variable.

The member function getName would return "var2" for it, but %var2 in 
here is a name of the value that is the function call instruction.  In 
general this doesn't have to be the name of the variable from the source 
code.


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list