Commit ae2949a7 authored by Alex Şuhan's avatar Alex Şuhan

More robust insertion point for arg_scratch

parent bf57cb22
...@@ -340,7 +340,7 @@ static ConcreteCompilerVariable* _call(IREmitter &emitter, llvm::Value* func, vo ...@@ -340,7 +340,7 @@ static ConcreteCompilerVariable* _call(IREmitter &emitter, llvm::Value* func, vo
// Don't use the IRBuilder since we want to specifically put this in the entry block so it only gets called once. // Don't use the IRBuilder since we want to specifically put this in the entry block so it only gets called once.
// TODO we could take this further and use the same alloca for all function calls? // TODO we could take this further and use the same alloca for all function calls?
llvm::Instruction* insertion_point = emitter.currentFunction()->func->getEntryBlock().getTerminator(); llvm::Instruction* insertion_point = emitter.currentFunction()->func->getEntryBlock().getFirstInsertionPt();
arg_array = new llvm::AllocaInst(g.llvm_value_type_ptr, n_varargs, "arg_scratch", insertion_point); arg_array = new llvm::AllocaInst(g.llvm_value_type_ptr, n_varargs, "arg_scratch", insertion_point);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment