Hi, I was wondering if there was any way to return an i1 type (or something that llvm would accept as one, internally) from a C function compiled with llvm-gcc. My thought from searching around was that it might take rewriting (or at least writing a wrapper to %trunc the result) in assembly. I'm fairly new to LLVM so I may have missed something important. Any thoughts ? Thanks much, Gordon Keiser -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110921/d5e19fc2/attachment.html>
Hi Gordon,> I was wondering if there was any way to return an i1 type (or something that > llvm would accept as one, internally) from a C function compiled with llvm-gcc.no, there is no way without modifying llvm-gcc. Ciao, Duncan.> My thought from searching around was that it might take rewriting (or at least > writing a wrapper to %trunc the result) in assembly. I’m fairly new to LLVM so I > may have missed something important. > > Any thoughts ? > > Thanks much, > > Gordon Keiser > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Hi Gordon, Clang can do it if you include <stdbool.h> . I found this out when writing a LibC wrapper library for LLVM Bitcode. --Sam>________________________________ >From: Gordon Keiser <gkeiser at arxan.com> >To: "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu> >Sent: Wednesday, September 21, 2011 9:55 PM >Subject: [LLVMdev] Returning i1 type ints from C code ? > > >Hi, > >I was wondering if there was any way to return an i1 type (or something that llvm would accept as one, internally) from a C function compiled with llvm-gcc. My thought from searching around was that it might take rewriting (or at least writing a wrapper to %trunc the result) in assembly. I’m fairly new to LLVM so I may have missed something important. > >Any thoughts ? > >Thanks much, >Gordon Keiser > >_______________________________________________ >LLVM Developers mailing list >LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >
Hi, Good to know. I tried that last night with llvm-gcc just in case, but alas, it didn't help. Good to know that Clang supports it for the future though. Thanks everyone, Gordon -----Original Message----- From: Samuel Crow [mailto:samuraileumas at yahoo.com] Sent: Thursday, September 22, 2011 1:08 PM To: Gordon Keiser Cc: LLVM Developers Mailing List Subject: Re: [LLVMdev] Returning i1 type ints from C code ? Hi Gordon, Clang can do it if you include <stdbool.h> . I found this out when writing a LibC wrapper library for LLVM Bitcode. --Sam>________________________________ >From: Gordon Keiser <gkeiser at arxan.com> >To: "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu> >Sent: Wednesday, September 21, 2011 9:55 PM >Subject: [LLVMdev] Returning i1 type ints from C code ? > > >Hi, > >I was wondering if there was any way to return an i1 type (or something >that llvm would accept as one, internally) from a C function compiled with llvm-gcc. My thought from searching around was that it might take rewriting (or at least writing a wrapper to %trunc the result) in assembly. I’m fairly new to LLVM so I may have missed something important. > >Any thoughts ? > >Thanks much, >Gordon Keiser > >_______________________________________________ >LLVM Developers mailing list >LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >