If what you're trying to do is use LLVM as a target-independent bitcode representation, you should be aware that it's not made for that purpose. In fact, it's specifically *not* target-independent, no matter what the types are. For you initial question, you cannot map back from LLVM IR to C types, because the two have little to do with each other. -bw On Apr 16, 2012, at 2:43 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:> So what I would like to do is redefine the widths for the types, making the type widths more portable and less target dependent, is this possible within llvm? > > On Mon, Apr 16, 2012 at 2:32 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > What is the best way to determine the type of an arbitrary int? For example, find whether it is a char, short, int, long, long, etc? > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Bill, Thanks, yes, I realize that's not what it's for; however, it looks like with a little tweaking it would be possible but I'd rather not change the LLVM base code. Guess I'll just have to write my own code to do this, thanks. Also, the initial question, so there's no way to tell if int8 was a char in LLVM? Thanks. On Mon, Apr 16, 2012 at 3:14 PM, Bill Wendling <wendling at apple.com> wrote:> If what you're trying to do is use LLVM as a target-independent bitcode > representation, you should be aware that it's not made for that purpose. In > fact, it's specifically *not* target-independent, no matter what the types > are. > > For you initial question, you cannot map back from LLVM IR to C types, > because the two have little to do with each other. > > -bw > > On Apr 16, 2012, at 2:43 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > > > So what I would like to do is redefine the widths for the types, making > the type widths more portable and less target dependent, is this possible > within llvm? > > > > On Mon, Apr 16, 2012 at 2:32 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: > > What is the best way to determine the type of an arbitrary int? For > example, find whether it is a char, short, int, long, long, etc? > > > > _______________________________________________ > > 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/20120416/d64880d5/attachment.html>
Chars don't exist in LLVM. Clang may map char to be i8, but LLVM doesn't know the difference. Joey On 17 April 2012 00:14, Ryan Taylor <ryta1203 at gmail.com> wrote:> Bill, > > Thanks, yes, I realize that's not what it's for; however, it looks like > with a little tweaking it would be possible but I'd rather not change the > LLVM base code. Guess I'll just have to write my own code to do this, > thanks. > > Also, the initial question, so there's no way to tell if int8 was a char > in LLVM? > > Thanks. > > > On Mon, Apr 16, 2012 at 3:14 PM, Bill Wendling <wendling at apple.com> wrote: > >> If what you're trying to do is use LLVM as a target-independent bitcode >> representation, you should be aware that it's not made for that purpose. In >> fact, it's specifically *not* target-independent, no matter what the types >> are. >> >> For you initial question, you cannot map back from LLVM IR to C types, >> because the two have little to do with each other. >> >> -bw >> >> On Apr 16, 2012, at 2:43 PM, Ryan Taylor <ryta1203 at gmail.com> wrote: >> >> > So what I would like to do is redefine the widths for the types, making >> the type widths more portable and less target dependent, is this possible >> within llvm? >> > >> > On Mon, Apr 16, 2012 at 2:32 PM, Ryan Taylor <ryta1203 at gmail.com> >> wrote: >> > What is the best way to determine the type of an arbitrary int? For >> example, find whether it is a char, short, int, long, long, etc? >> > >> > _______________________________________________ >> > 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 > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120417/d163f3b5/attachment.html>