<div dir="ltr">  llvm::Type::getInt32Ty(Context) really works ,and I found a lot of useful functions to create instructions in llvm::IRBuilder<>.<div><br></div><div>Thank you! Chuck</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/12/13 Caldarale, Charles R <span dir="ltr"><<a href="mailto:Chuck.Caldarale@unisys.com" target="_blank">Chuck.Caldarale@unisys.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> From: <a href="mailto:llvmdev-bounces@cs.uiuc.edu">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu">llvmdev-bounces@cs.uiuc.edu</a>]<br>
> On Behalf Of Jin Huang<br>
> Subject: [LLVMdev] LLVM Type Int32Ty Problems & LLVMContextImpl.h Problems<br>
<div class="im"><br>
>    AllocaInst *alloc = new AllocaInst(llvm::Int32Ty, 0, "indexLoc",i);<br>
<br>
</div>I think you should be using llvm::Type::getInt32Ty(Context), not llvm::Int32Ty, which is for internal LLVM usage.<br>
<br>
Also, using llvm::IRBuilder<> is a whole lot easier and safer than trying to create instruction objects directly.<br>
<br>
 - Chuck<br>
<br>
</blockquote></div><br></div>