[LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h Problems
Jin Huang
54jin.huang at gmail.com
Fri Dec 13 19:35:01 PST 2013
llvm::Type::getInt32Ty(Context) really works ,and I found a lot of useful
functions to create instructions in llvm::IRBuilder<>.
Thank you! Chuck
2013/12/13 Caldarale, Charles R <Chuck.Caldarale at unisys.com>
> > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> > On Behalf Of Jin Huang
> > Subject: [LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h
> Problems
>
> > AllocaInst *alloc = new AllocaInst(llvm::Int32Ty, 0, "indexLoc",i);
>
> I think you should be using llvm::Type::getInt32Ty(Context), not
> llvm::Int32Ty, which is for internal LLVM usage.
>
> Also, using llvm::IRBuilder<> is a whole lot easier and safer than trying
> to create instruction objects directly.
>
> - Chuck
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131214/4adb0d25/attachment.html>
More information about the llvm-dev
mailing list