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 | e6a76da763eb2e3cdc81766f02a3e1fad6dc5e31 (patch) | |
tree | bbd3f4799bb4daa7a61ccf3757ee54b5b8ed2351 /clang/CodeGen/CodeGenFunction.cpp | |
parent | a59e0064d3c203880dd7f84b190088cc457e3d5c (diff) | |
download | bcm5719-llvm-e6a76da763eb2e3cdc81766f02a3e1fad6dc5e31.tar.gz bcm5719-llvm-e6a76da763eb2e3cdc81766f02a3e1fad6dc5e31.zip |
Make the insertion point with an explicit new instead of the builder.
llvm-svn: 45118
Diffstat (limited to 'clang/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/CodeGen/CodeGenFunction.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/CodeGen/CodeGenFunction.cpp b/clang/CodeGen/CodeGenFunction.cpp index 5cbd1958f48..ad8011c7dbd 100644 --- a/clang/CodeGen/CodeGenFunction.cpp +++ b/clang/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(); |