[LLVMdev] How to use get the memory location of a function argument correctly?

Shen Liu shl413 at lehigh.edu
Thu Jul 9 13:06:12 PDT 2015


Hi all, i hope to get the MemoryLocation for argument %1 in a CallInst like
"call void @function(i32* %1)", and i found an interface "getForArgument()"
which seems available for this. However, i don't know how to correcly fill
the 3rd argument TargetLibraryInfo in my own code and can't find an example
in google. Does anybody know how to do it?  Or some other advice for find
the correct memory location more conveniently? Thank you very much!


MemoryLocation
<http://llvm.org/docs/doxygen/html/classllvm_1_1MemoryLocation.html>
MemoryLocation::getForArgument
<http://llvm.org/docs/doxygen/html/classllvm_1_1MemoryLocation.html#a09ad77e77770d1e517466a7345227ccc>
(ImmutableCallSite
<http://llvm.org/docs/doxygen/html/classllvm_1_1ImmutableCallSite.html> CS,
unsigned <http://llvm.org/docs/doxygen/html/classunsigned.html> ArgIdx,const
<http://llvm.org/docs/doxygen/html/AArch64PromoteConstant_8cpp.html#a90f8350fecae261c25be85d38b451bff>
 TargetLibraryInfo
<http://llvm.org/docs/doxygen/html/classllvm_1_1TargetLibraryInfo.html> &
TLI )[static]
Shen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150709/2a38c67d/attachment.html>


More information about the llvm-dev mailing list