[LLVMdev] Why function pointer is different from other data type?
victor.zverovich at googlemail.com
Mon Apr 12 09:20:01 PDT 2010
"float (i32)* (float (i32)*)*" is not a return type.
According to the description of the 'call' instruction in LLVM Assembly
Language Reference Manual (http://llvm.org/docs/LangRef.html#i_call) this
is a signature of the pointer to function value being invoked (which
includes the return type). In your case the full signature is printed
because get_ptr returns a pointer to function (read item 5 in the Arguments
section of the 'call' Instruction section).
On 12 April 2010 16:58, SHEN Hao <hao.shen at imag.fr> wrote:
> I'm sorry that I should remove the comment.
> In fact my question is about the "float (i32)* (float (i32)*)*", why
> we use this kind of return type instead of just "float (i32)*".
> Thanks a lot.
> On Mon, Apr 12, 2010 at 5:42 PM, Duncan Sands <baldrick at free.fr> wrote:
> > Hi Hao Shen,
> >> %4 = call float (i32)* (float (i32)*)* @get_ptr(float (i32)* @a1)
> >> nounwind ;<float (i32)*> [#uses=1]
> >> ~~~~~~~~~~~~~~~~~~~~ VERY STRANGE RETURN TYPE !!!
> > this is a comment, and only exists to help the human reader. Comments
> > start with a semi-colon (;). You can remove them if you like.
> > Ciao,
> > Duncan.
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> Hao Shen
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev