Пример #1
0
 def visit_FieldRef(self, node: FieldRef) -> gtir.FieldAccess:
     return gtir.FieldAccess(
         name=node.name,
         offset=self.transform_offset(node.offset),
         data_index=[self.visit(index) for index in node.data_index],
         loc=location_to_source_location(node.loc),
     )
Пример #2
0
 def visit_FieldAccess(self, node: gtir.FieldAccess,
                       **kwargs: Any) -> gtir.FieldAccess:
     return gtir.FieldAccess(
         name=node.name,
         offset=self.visit(node.offset, **kwargs),
         data_index=self.visit(node.data_index, **kwargs),
         dtype=kwargs["symtable"][node.name].dtype,
     )
Пример #3
0
 def visit_FieldAccess(self, node: gtir.FieldAccess, *, symtable: Dict[str,
                                                                       Any],
                       **kwargs: Any) -> gtir.FieldAccess:
     return gtir.FieldAccess(
         name=node.name,
         offset=node.offset,
         data_index=node.data_index,
         dtype=symtable[node.name].dtype,
     )
Пример #4
0
 def visit_FieldAccess(self, node: gtir.FieldAccess, *, symtable: Dict[str,
                                                                       Any],
                       **kwargs: Any) -> gtir.FieldAccess:
     if symtable[node.name].dtype == DataType.AUTO:
         assert "new_dtype" in kwargs
         symtable[node.name].dtype = kwargs["new_dtype"]
     return gtir.FieldAccess(name=node.name,
                             offset=node.offset,
                             dtype=symtable[node.name].dtype)
Пример #5
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())
Пример #6
0
 def visit_FieldAccess(self, node: gtir.FieldAccess, *, symtable: Dict[str,
                                                                       Any],
                       **kwargs: Any) -> gtir.FieldAccess:
     if symtable[node.name].dtype == DataType.AUTO:
         assert "new_dtype" in kwargs
         symtable[node.name].dtype = kwargs["new_dtype"]
     return gtir.FieldAccess(
         name=node.name,
         offset=self.visit(node.offset, symtable=symtable, **kwargs),
         data_index=self.visit(node.data_index, symtable=symtable,
                               **kwargs),
         dtype=symtable[node.name].dtype,
         loc=node.loc,
     )
Пример #7
0
 def visit_FieldRef(self, node: FieldRef):
     return gtir.FieldAccess(
         name=node.name,
         offset=self.transform_offset(node.offset),
         data_index=[self.visit(index) for index in node.data_index],
     )
Пример #8
0
 def visit_FieldRef(self, node: FieldRef):
     return gtir.FieldAccess(name=node.name,
                             offset=transform_offset(node.offset))