Skip to content

Commit

Permalink
Fix pruning of imported symbols when it appears in type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
mcopik committed Sep 10, 2024
1 parent 98a17ab commit fd58575
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
[submodule "dace/external/rtllib"]
path = dace/external/rtllib
url = https://github.com/carljohnsen/rtllib.git
[submodule "latex-tools"]
path = latex-tools
url = https://github.com/mcopik/latex-tools
12 changes: 12 additions & 0 deletions dace/frontend/fortran/ast_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ def eliminate_dependencies(dep_graph:nx.digraph.DiGraph):
for used_name in actually_used:
for var in res.list_of_module_vars:
for ii in var.children:

# Support scenario where an imported symbol appears in kind selector
# Example: REAL(KIND=JPRB) :: R2ES
# Where JPRB is imported from another module.
if ii.__class__.__name__ == "Intrinsic_Type_Spec":

for iii in ii.children:
if iii.__class__.__name__ == "Kind_Selector":
name_to_check = iii.children[1].string
if name_to_check not in actually_used:
actually_used.append(name_to_check)

if ii.__class__.__name__=="Entity_Decl_List":
for iii in ii.children:
if iii.__class__.__name__=="Entity_Decl":
Expand Down
1 change: 1 addition & 0 deletions latex-tools
Submodule latex-tools added at f4fb16

0 comments on commit fd58575

Please sign in to comment.