mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-15 17:15:10 +01:00
more stuff
This commit is contained in:
parent
77e18126e7
commit
c84fdfaf3a
12 changed files with 270 additions and 38 deletions
|
|
@ -23,7 +23,7 @@ impl<'a, 'cx> FuncBuilder<'a, 'cx> {
|
|||
regs: Vec::new(),
|
||||
bbs: vec![BasicBlock {
|
||||
statements: Vec::new(),
|
||||
term: Branch::Goto(BbIdx(0)),
|
||||
term: Branch::dummy(),
|
||||
}],
|
||||
name,
|
||||
def_span,
|
||||
|
|
@ -134,14 +134,12 @@ impl<'a, 'cx> FuncBuilder<'a, 'cx> {
|
|||
pub fn new_block(&mut self) -> BbIdx {
|
||||
self.ir.bbs.push(BasicBlock {
|
||||
statements: vec![],
|
||||
term: Branch::Goto(BbIdx(0)),
|
||||
term: Branch::dummy(),
|
||||
});
|
||||
BbIdx::from_usize(self.ir.bbs.len() - 1)
|
||||
}
|
||||
|
||||
pub fn finish(mut self) -> Func<'cx> {
|
||||
self.cur_bb_mut().term = Branch::Ret(Operand::Const(ConstValue::Void));
|
||||
|
||||
pub fn finish(self) -> Func<'cx> {
|
||||
println!("{}", ir::func_to_string(&self.ir));
|
||||
|
||||
self.ir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue