[LLVMdev] How to get a return type of a function with LLVM-C API

Matthijs Kooijman matthijs at stdin.nl
Thu May 22 08:02:20 PDT 2008


Hi Syoyo,

> I am trying to get a return type of a function(from bitcode file) with
> LLVM-C API, but there seems no appropriate API to do that.
From my memory, this info is stored in the function type, so you could look at
the function's type and get the info there.

Looking the the API docs [1], I find that there is a simple method on Function
called getReturnType(). You should thus be able to do:
	Type* rt = F->getReturnType();

Good luck,

Matthijs

[1]: http://llvm.org/doxygen/classllvm_1_1Function.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080522/295ddde9/attachment.sig>


More information about the llvm-dev mailing list