History log of /llvm-project/flang/lib/Semantics/tools.cpp (Results 1 – 25 of 125)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 2625510e 27-Jan-2025 Peter Klausler <pklausler@nvidia.com>

[flang] Refine EVENT_TYPE/LOCK_TYPE usage checks (#123244)

The event variable in an EVENT POST/WAIT statement can be a coarray
reference, and need not be an entire coarray.

Variables and potenti

[flang] Refine EVENT_TYPE/LOCK_TYPE usage checks (#123244)

The event variable in an EVENT POST/WAIT statement can be a coarray
reference, and need not be an entire coarray.

Variables and potential subobject components with EVENT_TYPE/LOCK_TYPE
must be coarrays, unless they are potential subobjects nested within
coarrays or pointers.

show more ...


# 038b42ba 27-Jan-2025 Peter Klausler <pklausler@nvidia.com>

[flang] Safer hermetic module file reading (#121002)

When a hermetic module file is read, use a new scope to hold its
dependent modules so that they don't conflict with any modules in the
global s

[flang] Safer hermetic module file reading (#121002)

When a hermetic module file is read, use a new scope to hold its
dependent modules so that they don't conflict with any modules in the
global scope.

show more ...


# ecf264d3 14-Jan-2025 Peter Klausler <pklausler@nvidia.com>

[flang] Fix spurious error message due to inaccessible generic binding (#122810)

Generic operator/assignment checks for distinguishable specific
procedures must ignore inaccessible generic bindings

[flang] Fix spurious error message due to inaccessible generic binding (#122810)

Generic operator/assignment checks for distinguishable specific
procedures must ignore inaccessible generic bindings.

Fixes https://github.com/llvm/llvm-project/issues/122764.

show more ...


# 9f0f54a6 14-Jan-2025 Peter Klausler <pklausler@nvidia.com>

[flang] Improve error messages for module self-USE (#122747)

A module can't USE itself, either directly within the top-level module
or from one of its submodules. Add a test for this case (which we

[flang] Improve error messages for module self-USE (#122747)

A module can't USE itself, either directly within the top-level module
or from one of its submodules. Add a test for this case (which we
already caught), and improve the diagnostic for the more confusing case
involving a submodule.

show more ...


# 96963554 14-Jan-2025 Peter Klausler <pklausler@nvidia.com>

[flang] Better messages and error recovery for a bad RESHAPE (#122604)

Add tests for negative array extents where necessary, motivated by a
compiler crash exposed by yet another fuzzer test, and im

[flang] Better messages and error recovery for a bad RESHAPE (#122604)

Add tests for negative array extents where necessary, motivated by a
compiler crash exposed by yet another fuzzer test, and improve overall
error message quality for RESHAPE().

Fixes https://github.com/llvm/llvm-project/issues/122060.

show more ...


Revision tags: llvmorg-19.1.7
# fc97d2e6 18-Dec-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Add UNSIGNED (#113504)

Implement the UNSIGNED extension type and operations under control of a
language feature flag (-funsigned).

This is nearly identical to the UNSIGNED feature that h

[flang] Add UNSIGNED (#113504)

Implement the UNSIGNED extension type and operations under control of a
language feature flag (-funsigned).

This is nearly identical to the UNSIGNED feature that has been available
in Sun Fortran for years, and now implemented in GNU Fortran for
gfortran 15, and proposed for ISO standardization in J3/24-116.txt.

See the new documentation for details; but in short, this is C's
unsigned type, with guaranteed modular arithmetic for +, -, and *, and
the related transformational intrinsic functions SUM & al.

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2
# 2f22656d 10-Oct-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Minor cleanup (move function into /tools.cpp) (#111587)

The semantics utility GetAllNames has declarations in two header files
and a definition that really should be in the common utilities

[flang] Minor cleanup (move function into /tools.cpp) (#111587)

The semantics utility GetAllNames has declarations in two header files
and a definition that really should be in the common utilities source
file. Remove the redudant declaration from resolve-names-utils.h and
move code from resolve-names-utils.cpp into Semantics/tools.cpp.

show more ...


# 70cbedcd 07-Oct-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Catch errors with INTENT(OUT) assumed rank dummy arguments (#111204)

Emit an error when an actual argument with potentially unknown size
(assumed size, or non-pointer non-allocatable assume

[flang] Catch errors with INTENT(OUT) assumed rank dummy arguments (#111204)

Emit an error when an actual argument with potentially unknown size
(assumed size, or non-pointer non-allocatable assumed rank) with any
risk of needing initialization, finalization, or destruction is
associated with an INTENT(OUT) dummy argument with assumed rank.

Emit an optional portability warning for cases where the type is known
to be safe from needing initialization, finalization, or destruction,
since it's not conforming and might elicit an error from other
compilers.

Fixes https://github.com/llvm/llvm-project/issues/111120.

show more ...


# 49016d53 07-Oct-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Silence bogus error message (#111057)

Fortran doesn't permit the use of a polymorphic I/O list item for
intrinsic data transfers, so the compiler emits an error message for
polymorphic ite

[flang] Silence bogus error message (#111057)

Fortran doesn't permit the use of a polymorphic I/O list item for
intrinsic data transfers, so the compiler emits an error message for
polymorphic items whose types can't possibly be handled by a defined I/O
subroutine. This check didn't allow for the possibility that the defined
I/O subroutine might apply to the parent component of an extended type.

Fixes https://github.com/llvm/llvm-project/issues/111021.

show more ...


Revision tags: llvmorg-19.1.1
# d5dd7d23 17-Sep-2024 Youngsuk Kim <youngsuk.kim@hpe.com>

[flang] Tidy uses of raw_string_ostream (NFC)

As specified in the docs,
1) raw_string_ostream is always unbuffered and
2) the underlying buffer may be used directly

( 65b13610a5226b84889b923bae884b

[flang] Tidy uses of raw_string_ostream (NFC)

As specified in the docs,
1) raw_string_ostream is always unbuffered and
2) the underlying buffer may be used directly

( 65b13610a5226b84889b923bae884ba395ad084d for further reference )

Avoid unneeded calls to raw_string_ostream::str(), to avoid excess indirection.

show more ...


Revision tags: llvmorg-19.1.0
# 9e53e772 04-Sep-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix warnings from more recent GCCs (#106567)

While experimenting with some more recent C++ features, I ran into
trouble with warnings from GCC 12.3.0 and 14.2.0. These warnings looked
legi

[flang] Fix warnings from more recent GCCs (#106567)

While experimenting with some more recent C++ features, I ran into
trouble with warnings from GCC 12.3.0 and 14.2.0. These warnings looked
legitimate, so I've tweaked the code to avoid them.

show more ...


Revision tags: llvmorg-19.1.0-rc4
# 143be4ea 20-Aug-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Silence spurious error (#104821)

Don't complain about a local object with an impure final procedure in a
pure subprogram when the local object is a named constant.

Fixes https://github.c

[flang] Silence spurious error (#104821)

Don't complain about a local object with an impure final procedure in a
pure subprogram when the local object is a named constant.

Fixes https://github.com/llvm/llvm-project/issues/104796.

show more ...


Revision tags: llvmorg-19.1.0-rc3
# 25822dc3 08-Aug-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix searches for polymorphic components (#102212)

FindPolymorphicAllocatableUltimateComponent needs to be
FindPolymorphicAllocatablePotentialComponent. The current search is
missing cases

[flang] Fix searches for polymorphic components (#102212)

FindPolymorphicAllocatableUltimateComponent needs to be
FindPolymorphicAllocatablePotentialComponent. The current search is
missing cases where a derived type has an allocatable component whose
type has a polymorphic allocatable component.

show more ...


Revision tags: llvmorg-19.1.0-rc2
# 539a6b50 30-Jul-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Detect use-before-decl errors on type parameters (#99947)

Ensure that type parameters are declared as such before being referenced
within the derived type definition. (Previously, such refe

[flang] Detect use-before-decl errors on type parameters (#99947)

Ensure that type parameters are declared as such before being referenced
within the derived type definition. (Previously, such references would
resolve to symbols in the enclosing scope.)

This change causes the symbols for the type parameters to be created
when the TYPE statement is processed in name resolution. They are
TypeParamDetails symbols with no KIND/LEN attribute set, and they shadow
any symbols of the same name in the enclosing scope.

When the type parameter declarations are processed, the KIND/LEN
attributes are set. Any earlier reference to a type parameter with no
KIND/LEN attribute elicits an error.

Some members of TypeParamDetails have been retyped &/or renamed.

show more ...


# 33c27f28 30-Jul-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Warn about undefined function results (#99533)

When the result of a function never appears in a variable definition
context, emit a warning.

If the function has multiple result variables

[flang] Warn about undefined function results (#99533)

When the result of a function never appears in a variable definition
context, emit a warning.

If the function has multiple result variables due to alternate ENTRY
statements, any definition will suffice.

The implementation of this check is tied to the general variable
definability checking utility in semantics. Every variable definition
context uses it to ensure that no undefinable variable is being defined.
A set of defined variables is maintained in the SemanticsContext and,
when the warning is enabled and no fatal error has been reported, the
scope tree is traversed and all the function subprograms' results are
tested for membership in that set.

show more ...


Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6
# a51d92a4 09-May-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix crash in semantics on error case (#91482)

An erroneous statement function declaration exposed an unhandled
situation in a utility routine in semantics. Patch that hole and add a
test.

[flang] Fix crash in semantics on error case (#91482)

An erroneous statement function declaration exposed an unhandled
situation in a utility routine in semantics. Patch that hole and add a
test.

Fixes https://github.com/llvm/llvm-project/issues/91429.

show more ...


Revision tags: llvmorg-18.1.5
# 505f6da1 01-May-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Ensure all warning/portability messages are guarded by Should… (#90518)

…Warn()

Many warning messages were being emitted unconditionally. Ensure that
all warnings are conditional on a tr

[flang] Ensure all warning/portability messages are guarded by Should… (#90518)

…Warn()

Many warning messages were being emitted unconditionally. Ensure that
all warnings are conditional on a true result from a call to
common::LanguageFeatureControl::ShouldWarn() so that it is easy for a
driver to disable them all, or, in the future, to provide per-warning
control over them.

show more ...


Revision tags: llvmorg-18.1.4, llvmorg-18.1.3
# f4fc959c 26-Mar-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Catch impossible but necessary TBP override (#86558)

An apparent attempt to override a type-bound procedure is not allowed to
be interpreted as on override when the procedure is PRIVATE and

[flang] Catch impossible but necessary TBP override (#86558)

An apparent attempt to override a type-bound procedure is not allowed to
be interpreted as on override when the procedure is PRIVATE and the
override attempt appears in another module. However, if the TBP that
would have been overridden is a DEFERRED procedure in an abstract base
type, the override must take place. PRIVATE DEFERRED procedures must
therefore have all of their overrides appear in the same module as the
abstract base type.

show more ...


# f92f7752 26-Mar-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang][NFC] Address reported "possible missing return" (#86523)

A function uses "if constexpr" to consider all possible types in a
variant, but looks as if it can fall out without returning an
ex

[flang][NFC] Address reported "possible missing return" (#86523)

A function uses "if constexpr" to consider all possible types in a
variant, but looks as if it can fall out without returning an
expression. Add a final "else" with a crash to make things more clear
and to protect against unlikely future extensions of the type.

Fixes https://github.com/llvm/llvm-project/issues/86391.

show more ...


# de7a50fb 22-Mar-2024 jeanPerier <jperier@nvidia.com>

[flang] Fix lowering of host associated cray pointee symbols (#86121)

Cray pointee symbols can be host associated from a module or host
procedure while the related cray pointer is not explicitly as

[flang] Fix lowering of host associated cray pointee symbols (#86121)

Cray pointee symbols can be host associated from a module or host
procedure while the related cray pointer is not explicitly associated.
This caused the "not yet implemented: lowering symbol to HLFIR" to fire
when lowering a reference to the cray pointee and fetching the cray
pointer.

This patch:
- Ensures cray pointers are always instantiated when instantiating a
cray pointee.
- Fix internal procedure lowering to deal with cray pointee host
association like it does for pointers (the lowering strategy for cray
pointee is to create a pointer that is updated with the cray pointer
value before being fetched).

This should fix the bug reported in
https://github.com/llvm/llvm-project/issues/85420.

show more ...


Revision tags: llvmorg-18.1.2
# 0c21377a 18-Mar-2024 Kelvin Li <kkwli@users.noreply.github.com>

[flang] Diagnose the impure procedure reference in finalization according to the rank of the entity (#85475)

Use the rank of the array section to determine which final procedure
would be called in

[flang] Diagnose the impure procedure reference in finalization according to the rank of the entity (#85475)

Use the rank of the array section to determine which final procedure
would be called in diagnosing whether that procedure is impure or not.

show more ...


Revision tags: llvmorg-18.1.1
# 83ca78de 05-Mar-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Emit "raw" name for procedure interface in module file (#83915)

Save both the raw procedure interface symbol as well as the result of
passing it through GetUltimate() and BypassGeneric() in

[flang] Emit "raw" name for procedure interface in module file (#83915)

Save both the raw procedure interface symbol as well as the result of
passing it through GetUltimate() and BypassGeneric() in symbol table
entries with ProcEntityDetails. The raw symbol of the interface needs to
be the one used for emitting procedure symbols to module files.

Fixes https://github.com/llvm/llvm-project/issues/83836.

show more ...


Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1
# 2b7a928d 26-Jan-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Improve USE merging of homonymous types, interfaces, and proc… (#79364)

…edures

Fortran allows a generic interface to have the same name as a derived
type in the same scope. It also allo

[flang] Improve USE merging of homonymous types, interfaces, and proc… (#79364)

…edures

Fortran allows a generic interface to have the same name as a derived
type in the same scope. It also allows a generic interface to have the
same name as one of its specific procedures.

When two modules define the same name, possibly more than once each,
things get exciting. The standard is not clear, and other compilers do
variously different things. We are currently emitting some errors
prematurely for some usage in pfUnit due to how it combines two versions
of a package together via USE association.

This patch handles combinations of derived types and generic interfaces
and their specific procedures in a more principled way. Errors due to
ambiguity are deferred to actual usage of derived types and specific
procedures -- and when they're not used, the program is unambiguous and
no error issues.

show more ...


Revision tags: llvmorg-19-init
# 89165e8b 30-Nov-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang][openacc] Disable CUDA argument checks in OpenACC regions (#72310)

Checks for CUDA Fortran data attribute compatibility don't need to be
applied in OpenACC regions.


Revision tags: llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3
# be66a2f6 03-Oct-2023 Slava Zakharin <szakharin@nvidia.com>

[flang] Deallocate components of local variables at the end of the scope. (#68064)

Call Destroy runtime for local variables of derived types with
allocatable components.


12345