[cfe-commits] r45118 - /cfe/trunk/CodeGen/CodeGenFunction.cpp

Chris Lattner sabre at nondot.org
Mon Dec 17 12:50:59 PST 2007


Author: lattner
Date: Mon Dec 17 14:50:59 2007
New Revision: 45118

URL: http://llvm.org/viewvc/llvm-project?rev=45118&view=rev
Log:
Make the insertion point with an explicit new instead of the builder.

Modified:
    cfe/trunk/CodeGen/CodeGenFunction.cpp

Modified: cfe/trunk/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenFunction.cpp?rev=45118&r1=45117&r2=45118&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenFunction.cpp Mon Dec 17 14:50:59 2007
@@ -70,12 +70,14 @@
   
   llvm::BasicBlock *EntryBB = new llvm::BasicBlock("entry", CurFn);
   
-  Builder.SetInsertPoint(EntryBB);
-
   // Create a marker to make it easy to insert allocas into the entryblock
-  // later.
+  // later.  Don't create this with the builder, because we don't want it
+  // folded.
   llvm::Value *Undef = llvm::UndefValue::get(llvm::Type::Int32Ty);
-  AllocaInsertPt = Builder.CreateBitCast(Undef,llvm::Type::Int32Ty, "allocapt");
+  AllocaInsertPt = new llvm::BitCastInst(Undef, llvm::Type::Int32Ty, "allocapt",
+                                         EntryBB);
+  
+  Builder.SetInsertPoint(EntryBB);
   
   // Emit allocs for param decls.  Give the LLVM Argument nodes names.
   llvm::Function::arg_iterator AI = CurFn->arg_begin();





More information about the cfe-commits mailing list