[LLVMdev] Printing Function Arguments

Óscar Fuentes ofv at wanadoo.es
Sun Sep 27 20:24:35 PDT 2009


ivtm <martinaide1 at yahoo.com> writes:

> Another question, I need to get the "%0" below in the:
>
> %0 = tail call i32 (...)* @__FFF (i32 8) nounwind; <i32> [#uses=1]
>
> that is, the return register. 

What information do you want, exactly?

In your example, %0 is the CallInst. So if you have

CallInst *ci = CallInst::Create(...

then use `ci' whenever you want to use %0.

> I am wondering in general, where should I look in the llvm codebase for
> parsing instructions ?
>
> I am looking at existing passes and also the header files like Function.h,
> etc to see what methods they have, but it takes a while to figure out the
> basic methods...

This is a bit better than looking at header files:

http://llvm.org/doxygen/classes.html

-- 
Óscar




More information about the llvm-dev mailing list