chore: add debug-mode assertions

This commit is contained in:
Shunsuke Shibayama 2023-10-07 14:49:10 +09:00
parent fd74117c50
commit 6cc4e19827
3 changed files with 17 additions and 2 deletions

View file

@ -21,7 +21,7 @@ use crate::varinfo::VarInfo;
/// Summarize lowering, side-effect checking, and ownership checking
#[derive(Debug)]
pub struct HIRBuilder {
lowerer: ASTLowerer,
pub(crate) lowerer: ASTLowerer,
ownership_checker: OwnershipChecker,
}
@ -207,4 +207,8 @@ impl HIRBuilder {
pub fn get_var_info(&self, name: &str) -> Option<(&VarName, &VarInfo)> {
ContextProvider::get_var_info(self, name)
}
pub fn current_ctx(&self) -> &Context {
&self.lowerer.module.context
}
}