SHEN Hao
2010-Apr-12 15:58 UTC
[LLVMdev] Why function pointer is different from other data type?
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. Hao 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
Victor Zverovich
2010-Apr-12 16:20 UTC
[LLVMdev] Why function pointer is different from other data type?
"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). Victor 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. > Hao > > 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 > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100412/2e1de608/attachment.html>
SHEN Hao
2010-Apr-12 16:31 UTC
[LLVMdev] Why function pointer is different from other data type?
OK. I understand. Thanks a lot for all of you. Best regards, Hao On Mon, Apr 12, 2010 at 6:20 PM, Victor Zverovich <victor.zverovich at googlemail.com> wrote:> "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). > Victor > > 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. >> Hao >> >> 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 >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-- Hao Shen
Apparently Analagous Threads
- [LLVMdev] Why function pointer is different from other data type?
- [LLVMdev] Why function pointer is different from other data type?
- [LLVMdev] Why function pointer is different from other data type?
- [LLVMdev] Why function pointer is different from other data type?
- [LLVMdev] How can I remove Intrinsic Functions during llvm-gcc compilation?