Add basic blocks and implementation of flattening thunks -> basic blocks
* Basic are a more linear way of representing code. Thunks beget basic blocks, which beget vectors of instructions. * Basic blocks are also being flattened into a vector of instructions (hopefully, no tests done yet) * OH yeah locals can be collected too (but currently are not being collected in the compiler, that should come soon) Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -23,3 +23,20 @@ pub trait Visit {
|
||||
fn visit_access_expr(&mut self, expr: &AccessExpr) -> Self::Out;
|
||||
fn visit_atom(&mut self, atom: &Atom) -> Self::Out;
|
||||
}
|
||||
|
||||
/*
|
||||
copy/paste of default_accepts
|
||||
|
||||
fn visit_body(&mut self, body: &Body) -> Self::Out { DefaultAccept::default_accept(body, self); }
|
||||
fn visit_stmt(&mut self, stmt: &Stmt) -> Self::Out { DefaultAccept::default_accept(stmt, self); }
|
||||
fn visit_assign_stmt(&mut self, assign: &AssignStmt) -> Self::Out { DefaultAccept::default_accept(assign, self); }
|
||||
fn visit_lhs_expr(&mut self, lhs_expr: &LhsExpr) -> Self::Out { DefaultAccept::default_accept(lhs_expr, self); }
|
||||
fn visit_expr(&mut self, expr: &Expr) -> Self::Out { DefaultAccept::default_accept(expr, self); }
|
||||
fn visit_bin_expr(&mut self, expr: &BinExpr) -> Self::Out { DefaultAccept::default_accept(expr, self); }
|
||||
fn visit_un_expr(&mut self, expr: &UnExpr) -> Self::Out { DefaultAccept::default_accept(expr, self); }
|
||||
fn visit_call_expr(&mut self, expr: &CallExpr) -> Self::Out { DefaultAccept::default_accept(expr, self); }
|
||||
fn visit_index_expr(&mut self, expr: &IndexExpr) -> Self::Out { DefaultAccept::default_accept(expr, self); }
|
||||
fn visit_access_expr(&mut self, expr: &AccessExpr) -> Self::Out { DefaultAccept::default_accept(expr, self); }
|
||||
fn visit_atom(&mut self, atom: &Atom) -> Self::Out { DefaultAccept(atom, self); }
|
||||
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user