Skip to content

Commit

Permalink
#2419 Rename some more references
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Jan 22, 2024
1 parent 5aa46b5 commit efab55b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion doc/developer_guide/psyir_symbols.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ optional argument. This would probably require a separate `setter` and
Specialising Symbols
====================

When code is translated into PSyIR there may be symbols with unknown
When code is translated into PSyIR there may be symbols with unresolved
types, perhaps due to symbols being declared in different files. For
example, in the following declaration it is not possible to know the
type of symbol `fred` without knowing the contents of the `my_module`
Expand Down
2 changes: 1 addition & 1 deletion src/psyclone/tests/psyir/nodes/array_mixin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def test_get_symbol_imported(fortran_reader):
assert not array_ref._is_bound(0, "upper")


def test_get_symbol_unknownfortrantype(fortran_reader):
def test_get_symbol_unsupporedfortrantype(fortran_reader):
'''Test the _is_bound method returns False when the array access
datatype is an UnsupportedFortranType.
Expand Down
22 changes: 11 additions & 11 deletions src/psyclone/tests/psyir/nodes/array_reference_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,22 +531,22 @@ def test_array_datatype():
aref = ArrayReference.create(asym, [two.copy()])
assert aref.datatype is stype
# Reference to a single element of an array of UnsupportedType.
unknown_sym = DataSymbol(
"unknown",
UnsupportedFortranType("real, dimension(5), pointer :: unknown"))
aref = ArrayReference.create(unknown_sym, [two.copy()])
unsuppored_sym = DataSymbol(
"unsuppored",
UnsupportedFortranType("real, dimension(5), pointer :: unsuppored"))
aref = ArrayReference.create(unsuppored_sym, [two.copy()])
assert isinstance(aref.datatype, UnresolvedType)
# Reference to a single element of an array of UnsupportedType but with
# partial type information.
not_quite_unknown_sym = DataSymbol(
"unknown",
not_quite_unsuppored_sym = DataSymbol(
"unsuppored",
UnsupportedFortranType(
"real, dimension(5), pointer :: unknown",
"real, dimension(5), pointer :: unsuppored",
partial_datatype=ArrayType(REAL_SINGLE_TYPE, [5])))
bref = ArrayReference.create(not_quite_unknown_sym, [two.copy()])
bref = ArrayReference.create(not_quite_unsuppored_sym, [two.copy()])
assert bref.datatype == REAL_SINGLE_TYPE
# A sub-array of UnsupportedFortranType.
aref3 = ArrayReference.create(unknown_sym, [Range.create(two.copy(),
aref3 = ArrayReference.create(unsuppored_sym, [Range.create(two.copy(),
four.copy())])
# We know the result is an ArrayType
assert isinstance(aref3.datatype, ArrayType)
Expand All @@ -557,8 +557,8 @@ def test_array_datatype():
assert isinstance(aref3.datatype.intrinsic, UnresolvedType)
# A whole array of UnsupportedType should simply have the same datatype as
# the original symbol.
aref4 = ArrayReference.create(not_quite_unknown_sym, [":"])
assert aref4.datatype == not_quite_unknown_sym.datatype
aref4 = ArrayReference.create(not_quite_unsuppored_sym, [":"])
assert aref4.datatype == not_quite_unsuppored_sym.datatype


def test_array_create_colon(fortran_writer):
Expand Down
12 changes: 6 additions & 6 deletions src/psyclone/tests/psyir/symbols/datatype_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def test_arraytype_datatypesymbol():
assert atype.precision is None


def test_arraytype_unknowntype():
def test_arraytype_unsupportedtype():
'''Test that we can construct an ArrayType when the type of the elements
is an UnsupportedType.'''
utype = UnsupportedFortranType("integer, pointer :: var")
Expand Down Expand Up @@ -574,7 +574,7 @@ def test_arraytype_eq():

# UnsupportedFortranType tests

def test_unknown_fortran_type():
def test_unsupported_fortran_type():
''' Check the constructor and 'declaration' property of the
UnsupportedFortranType class. '''
with pytest.raises(TypeError) as err:
Expand All @@ -589,7 +589,7 @@ def test_unknown_fortran_type():
assert utype._declaration == decl


def test_unknown_fortran_type_optional_arg():
def test_unsupported_fortran_type_optional_arg():
'''Check the optional 'partial_datatype' argument of the
UnsupportedFortranType class works as expected. Also check the getter
method and the string methods work as expected when
Expand All @@ -614,7 +614,7 @@ def test_unknown_fortran_type_optional_arg():
assert str(utype) == f"UnsupportedFortranType('{decl}')"


def test_unknown_fortran_type_text():
def test_unsupported_fortran_type_text():
'''
Check that the 'type_text' property returns the expected string and
that the result is cached.
Expand All @@ -636,7 +636,7 @@ def test_unknown_fortran_type_text():
assert utype3.type_text == "COMMON"


def test_unknown_fortran_type_text_error():
def test_unsupported_fortran_type_text_error():
'''
Check that the expected error is raised if the 'type_text' is requested
for something that is not a straightforward declaration.
Expand Down Expand Up @@ -665,7 +665,7 @@ def test_unknown_fortran_type_text_error():
"Fortran2003.Specification_Part) failed." in str(err.value))


def test_unknown_fortran_type_eq():
def test_unsupported_fortran_type_eq():
'''Test the equality operator for UnsupportedFortranType.'''
decl = "type(some_type) :: var"
utype = UnsupportedFortranType(decl)
Expand Down
8 changes: 4 additions & 4 deletions src/psyclone/tests/psyir/transformations/inline_trans_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,12 @@ def test_apply_unresolved_struct_arg(fortran_reader, fortran_writer):
" use some_mod, only: mystery_type, mystery\n"
" integer :: i\n"
" type(mystery_type) :: var3, varr(5)\n"
# Unknown structure type but array dims are known.
# Unresolved structure type but array dims are known.
" call sub3(varr)\n"
# Unknown actual argument corresponding to a formal array argument
# Unresolved actual argument corresponding to a formal array argument
# so we can't be sure that it isn't being reshaped.
" call sub3(mystery)\n"
# Unknown actual argument corresponding to a formal scalar argument
# Unresolved actual argument corresponding to a formal scalar argument
# so lack of type information isn't a problem.
" call sub3a(mystery)\n"
# Formal arg specifies array bounds and we don't have them for
Expand Down Expand Up @@ -1600,7 +1600,7 @@ def test_validate_codeblock(fortran_reader):
"cannot be inlined" in str(err.value))


def test_validate_unknowntype_argument(fortran_reader):
def test_validate_unsupportedtype_argument(fortran_reader):
'''
Test that validate rejects a subroutine with arguments of UnsupportedType.
Expand Down

0 comments on commit efab55b

Please sign in to comment.