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

@@ -40,14 +40,21 @@ pub trait BuilderMethods<'a, 'tcx>:
+ HasParamEnv<'tcx>
+ HasTargetSpec
{
fn new_block<'b>(cx: &'a Self::CodegenCx, llfn: Self::Function, name: &'b str) -> Self;
fn with_cx(cx: &'a Self::CodegenCx) -> Self;
fn build_sibling_block(&self, name: &str) -> Self;
fn build(cx: &'a Self::CodegenCx, llbb: Self::BasicBlock) -> Self;
fn cx(&self) -> &Self::CodegenCx;
fn llbb(&self) -> Self::BasicBlock;
fn set_span(&mut self, span: Span);
fn position_at_end(&mut self, llbb: Self::BasicBlock);
// FIXME(eddyb) replace uses of this with `append_sibling_block`.
fn append_block(cx: &'a Self::CodegenCx, llfn: Self::Function, name: &str) -> Self::BasicBlock;
fn append_sibling_block(&mut self, name: &str) -> Self::BasicBlock;
// FIXME(eddyb) replace with callers using `append_sibling_block`.
fn build_sibling_block(&mut self, name: &str) -> Self;
fn ret_void(&mut self);
fn ret(&mut self, v: Self::Value);
fn br(&mut self, dest: Self::BasicBlock);