1
Fork 0

rustc_codegen_ssa: append blocks to functions w/o creating a builder.

This commit is contained in:
Eduard-Mihai Burtescu 2021-05-06 18:57:04 +03:00
parent 402e9efc56
commit 0fcaf11455
7 changed files with 54 additions and 38 deletions

View file

@ -678,7 +678,8 @@ fn gen_fn<'ll, 'tcx>(
cx.apply_target_cpu_attr(llfn);
// FIXME(eddyb) find a nicer way to do this.
unsafe { llvm::LLVMRustSetLinkage(llfn, llvm::Linkage::InternalLinkage) };
let bx = Builder::new_block(cx, llfn, "entry-block");
let llbb = Builder::append_block(cx, llfn, "entry-block");
let bx = Builder::build(cx, llbb);
codegen(bx);
llfn
}