diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-17 20:50:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-17 20:50:59 +0000 |
commit | 55352a2d616cf9fbb621d10faf8b960b4b268bd8 (patch) | |
tree | bd9069c8534aa4d533ba41948aa7ced515428bfd /CodeGen/CodeGenFunction.cpp | |
parent | 7e3a89db59513acaf7ecfb51ef8998efbb51a5b8 (diff) |
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
Diffstat (limited to 'CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | CodeGen/CodeGenFunction.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/CodeGen/CodeGenFunction.cpp b/CodeGen/CodeGenFunction.cpp index 5cbd1958f4..ad8011c7db 100644 --- a/CodeGen/CodeGenFunction.cpp +++ b/CodeGen/CodeGenFunction.cpp @@ -70,12 +70,14 @@ void CodeGenFunction::GenerateCode(const FunctionDecl *FD) { 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(); |