Make the insertion point with an explicit new instead of the builder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45118 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CodeGenFunction.cpp b/CodeGen/CodeGenFunction.cpp
index 5cbd195..ad8011c 100644
--- a/CodeGen/CodeGenFunction.cpp
+++ b/CodeGen/CodeGenFunction.cpp
@@ -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();