def visit_VarRef(self, node: VarRef, **kwargs): # TODO(havogt) seems wrong, but check the DefinitionIR for # test_code_generation.py::test_generation_cpu[native_functions, # there we have a FieldAccess on a VarDecl # Probably the frontend needs to be fixed. if node.name in self._scalar_params: return gtir.ScalarAccess(name=node.name) else: return gtir.FieldAccess(name=node.name, offset=gtir.CartesianOffset.zero())
def visit_VarRef(self, node: VarRef, **kwargs): return gtir.ScalarAccess(name=node.name)
def visit_ScalarAccess(self, node: gtir.ScalarAccess, *, symtable: Dict[str, Any], **kwargs: Any) -> gtir.ScalarAccess: return gtir.ScalarAccess(name=node.name, dtype=symtable[node.name].dtype)
def visit_VarRef(self, node: VarRef, **kwargs): return gtir.ScalarAccess(name=node.name, loc=location_to_source_location(node.loc))