예제 #1
0
 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())
예제 #2
0
 def visit_VarRef(self, node: VarRef, **kwargs):
     return gtir.ScalarAccess(name=node.name)
예제 #3
0
 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)
예제 #4
0
 def visit_VarRef(self, node: VarRef, **kwargs):
     return gtir.ScalarAccess(name=node.name,
                              loc=location_to_source_location(node.loc))