[llvm-dev] How to get the arguments of a function call in LLVM? (original) (raw)
Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 19 09:28:03 PDT 2017
- Previous message: [llvm-dev] How to get the arguments of a function call in LLVM?
- Next message: [llvm-dev] [cfe-dev] FE_INEXACT being set for an exact conversion from float to unsigned long long
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 19 April 2017 at 09:05, Dipanjan Das via llvm-dev <llvm-dev at lists.llvm.org> wrote:
If I run the pass through
opt
, it produces the followingmalloc : 0x3df3f40 i64 %0 What does
0x3df3f40
represent?
getArgOperand returns a pointer to a Value object. You're printing that pointer directly rather than calling its print method to get a sensible representation.
Instead of
164
and512
, why does it producei64
and%0
?
That's because you're iterating through the argument as it exists at the function's definition/declaration rather than the callsite. You should be using the CallInst's accessors rather than the Function's if you want the arguments used for this particular call.
Cheers.
Tim.
- Previous message: [llvm-dev] How to get the arguments of a function call in LLVM?
- Next message: [llvm-dev] [cfe-dev] FE_INEXACT being set for an exact conversion from float to unsigned long long
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]