Skip to content

Commit

Permalink
Rename SubroutineItem to ProcedureItem in recently changed code
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Jan 31, 2024
1 parent 59c39cd commit fa5656e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions loki/transform/transform_hoist_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
from loki.visitors import Transformer, FindNodes
from loki.transform.transformation import Transformation
from loki.transform.transform_utilities import single_variable_declaration
from loki.bulk.item import SubroutineItem
from loki.bulk.item import ProcedureItem
import loki.expression.symbols as sym


Expand Down Expand Up @@ -151,7 +151,7 @@ def transform_subroutine(self, routine, **kwargs):
call_map = CaseInsensitiveDict((str(call.name), call) for call in calls)

for child in successors:
if not isinstance(child, SubroutineItem):
if not isinstance(child, ProcedureItem):
continue
arg_map = dict(call_map[child.local_name].arg_iter())
hoist_variables = []
Expand Down Expand Up @@ -313,15 +313,15 @@ def driver_call_argument_remapping(self, routine, call, variables):
def kernel_call_argument_remapping(self, routine, call, variables):
"""
Callback method to re-map hoisted arguments in kernel-to-kernel calls.
The callback will simply add all the hoisted variable arrays to the call
without dimension range symbols.
This callback is used to adjust the argument variable mapping, so that
the call signature can be adjusted to the declaration
scheme of subclassed variants of the basic hoisting transformation.
Potentially, different variants of the hoist transformation can override
the behaviour here to map to a different call invocation scheme.
Parameters
----------
routine : :any:`Subroutine`
Expand Down
6 changes: 3 additions & 3 deletions transformations/tests/test_transform_derived_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ def test_transform_derived_type_arguments_expansion_trivial_derived_type(fronten
source = Sourcefile.from_source(fcode, frontend=frontend)

call_tree = [
SubroutineItem(name='transform_derived_type_arguments_mod#caller', source=source, config={'role': 'driver'}),
SubroutineItem(name='transform_derived_type_arguments_mod#kernel', source=source, config={'role': 'kernel'}),
ProcedureItem(name='transform_derived_type_arguments_mod#caller', source=source, config={'role': 'driver'}),
ProcedureItem(name='transform_derived_type_arguments_mod#kernel', source=source, config={'role': 'kernel'}),
]

# Apply transformation
transformation = DerivedTypeArgumentsTransformation(all_derived_types=all_derived_types)
for item, successor in reversed(list(zip_longest(call_tree, call_tree[1:]))):
transformation.apply(item.routine, role=item.role, item=item, successors=as_tuple(successor))
transformation.apply(item.scope_ir, role=item.role, item=item, successors=as_tuple(successor))

# all derived types, disregarding whether the derived type has pointer/allocatable/derived type members or not
if all_derived_types:
Expand Down

0 comments on commit fa5656e

Please sign in to comment.