Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions source/fab/parse/x90.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
from pathlib import Path
from typing import Iterable, Set, Union, Optional, Dict, Any

from fparser.two.Fortran2003 import Use_Stmt, Call_Stmt, Name, Only_List, Actual_Arg_Spec_List, Part_Ref # type: ignore
from fparser.two.Fortran2003 import ( # type: ignore
Use_Stmt, Call_Stmt, Name, Only_List, Actual_Arg_Spec_List,
Part_Ref)
from fparser.two.utils import walk # type: ignore
try:
from psyclone.domain.lfric.lfric_builtins import BUILTIN_MAP # type: ignore
except ImportError:
BUILTIN_MAP = {}
Comment on lines +13 to +16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the PSyclone source, the BUILTIN_MAP variable was added 9 years ago so is there a need to handle its non-existance?


from fab.parse import AnalysedFile
from fab.build_config import BuildConfig
from fab.parse.fortran_common import FortranAnalyserBase, logger, _typed_child
from fab.parse import AnalysedFile
from fab.util import by_type


Expand All @@ -21,7 +27,8 @@ class AnalysedX90(AnalysedFile):

"""
def __init__(self, fpath: Union[str, Path], file_hash: int,
# todo: the fortran version doesn't include the remaining args - update this too, for simplicity.
# todo: the fortran version doesn't include the remaining
# args - update this too, for simplicity.
kernel_deps: Optional[Iterable[str]] = None):
"""
:param fpath:
Expand Down Expand Up @@ -123,4 +130,5 @@ def _process_call_statement(self, symbol_deps: Dict[str, str], analysed_file, ob
if arg_name in symbol_deps:
analysed_file.kernel_deps.add(arg_name)
else:
logger.debug(f"arg '{arg_name}' to invoke() was not used, presumed built-in kernel")
if arg_name.lower() not in BUILTIN_MAP:
logger.debug(f"arg '{arg_name}' is unknown.")