Remove scope.get

This commit is contained in:
Ayaz Hafiz 2023-06-09 15:42:45 -05:00
parent bbef63f28f
commit 4d65db22d2
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 6 additions and 13 deletions

View file

@ -20,12 +20,8 @@ pub(crate) struct Scope<'a, 'ctx> {
pub(crate) struct JoinPointNotFound;
impl<'a, 'ctx> Scope<'a, 'ctx> {
pub fn get(&self, symbol: &Symbol) -> Option<&(InLayout<'a>, BasicValueEnum<'ctx>)> {
self.symbols.get(symbol)
}
pub fn load_symbol(&self, symbol: &Symbol) -> BasicValueEnum<'ctx> {
match self.get(symbol) {
match self.symbols.get(symbol) {
Some((_, ptr)) => *ptr,
None => panic!(
@ -39,7 +35,7 @@ impl<'a, 'ctx> Scope<'a, 'ctx> {
&self,
symbol: &Symbol,
) -> (BasicValueEnum<'ctx>, InLayout<'a>) {
match self.get(symbol) {
match self.symbols.get(symbol) {
Some((layout, ptr)) => (*ptr, *layout),
None => panic!("There was no entry for {:?} in scope {:?}", symbol, self),
}