History log of /llvm-project/flang/lib/Evaluate/type.cpp (Results 1 – 25 of 59)
Revision Date Author Comments
# 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 ...


# 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 ...


# 35e86245 15-Oct-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Silence impossible error about SMP interface incompatibility (#112054)

It is possible for the compiler to emit an impossible error message
about dummy argument character length incompatibil

[flang] Silence impossible error about SMP interface incompatibility (#112054)

It is possible for the compiler to emit an impossible error message
about dummy argument character length incompatibility in the case of a
MODULE SUBROUTINE or FUNCTION defined later in a submodule with MODULE
PROCEDURE, when the character length is defined by USE association in
its interface. The checking for separate module procedure interface
compatibility needs to use a more flexible check than just operator== on
a semantics::ParamValue.

show more ...


# ce392471 10-Sep-2024 Peter Klausler <pklausler@nvidia.com>

[flang] Silence spurious error on non-CUDA use of CUDA module (#107444)

When a module file has been compiled with CUDA enabled, don't emit
spurious errors about non-interoperable types when that mo

[flang] Silence spurious error on non-CUDA use of CUDA module (#107444)

When a module file has been compiled with CUDA enabled, don't emit
spurious errors about non-interoperable types when that module is read
by a USE statement in a later non-CUDA compilation.

show more ...


# d46c639e 08-Aug-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix derived type compatibility checking in ALLOCATE (#102035)

The derived type compatibility checking for ALLOCATE statements with
SOURCE= or MOLD= was only checking for the same derived ty

[flang] Fix derived type compatibility checking in ALLOCATE (#102035)

The derived type compatibility checking for ALLOCATE statements with
SOURCE= or MOLD= was only checking for the same derived type name. That
is a necessary but not sufficient check, and it can produce bogus errors
as well as miss valid errors.

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

show more ...


# 60c90336 11-Jul-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Silence over-eager warning about interoperable character length (#97353)

Make the results of the two IsInteroperableIntrinsicType() utility
routines a tri-state std::optional<bool> so that

[flang] Silence over-eager warning about interoperable character length (#97353)

Make the results of the two IsInteroperableIntrinsicType() utility
routines a tri-state std::optional<bool> so that cases where the
character length is simply unknown can be distinguished from those cases
where the length is known and not acceptable. Use this distinction to
not emit a confusing warning about interoperability with C_LOC()
arguments when the length is unknown and might well be acceptable during
execution.

show more ...


# 82a8c1cf 24-Apr-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang][runtime] Support SELECTED_CHAR_KIND, SELECTED_LOGICAL_KIND (#89691)

Add code to the runtime support library for the SELECTED_CHAR_KIND and
SELECTED_LOGICAL_KIND intrinsic functions. These a

[flang][runtime] Support SELECTED_CHAR_KIND, SELECTED_LOGICAL_KIND (#89691)

Add code to the runtime support library for the SELECTED_CHAR_KIND and
SELECTED_LOGICAL_KIND intrinsic functions. These are usually used with
constant folding in constant expressions, but the are available for use
with dynamic arguments as well.

Lowering support remains to be implemented.

show more ...


# 7b801233 15-Jan-2024 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] More support for assumed-size Cray pointees (#77381)

Recognize Cray pointees as such when they are declared as assumed size
arrays, and don't emit a bogus error message about implied shape

[flang] More support for assumed-size Cray pointees (#77381)

Recognize Cray pointees as such when they are declared as assumed size
arrays, and don't emit a bogus error message about implied shape arrays.

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

show more ...


# b1b4bf06 31-Oct-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix build warning on now-unused variable (#70852)

A recent change of mine caused a local variable to become obsolete in
its function, leading to a warning with some build compilers that is

[flang] Fix build warning on now-unused variable (#70852)

A recent change of mine caused a local variable to become obsolete in
its function, leading to a warning with some build compilers that is
fatal under -Werror, breaking a build bot. Remove the variable.

show more ...


# 2d4ada21 31-Oct-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Fix IsDescriptor() to fix SMP compatibility checking (#70676)

Fix IsDescriptor() so that it doesn't return a false negative result
that messes up compatibility checking between a separate m

[flang] Fix IsDescriptor() to fix SMP compatibility checking (#70676)

Fix IsDescriptor() so that it doesn't return a false negative result
that messes up compatibility checking between a separate module
procedure's interface and its redundant definition (without MODULE
PROCEDURE). Specifically, lower bounds just don't matter, and any upper
bound that's not explicit is dispositive.

show more ...


# c2f642d9 30-Oct-2023 Peter Klausler <35819229+klausler@users.noreply.github.com>

[flang] Derived type structural equivalence (#69376)

F'202X 7.5.2.4 describes conditions under which two derived type
definitions are to be considered equivalent. These rules are already
implement

[flang] Derived type structural equivalence (#69376)

F'202X 7.5.2.4 describes conditions under which two derived type
definitions are to be considered equivalent. These rules are already
implemented in Evaluate/type.cpp but not exposed for general use;
rearrange the code a little so that the compatibility checking of
separate module procedure interfaces and explicit definitions can use it
to avoid emitting a bogus error message.

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

show more ...


# 0a10e889 27-Oct-2023 jeanPerier <jperier@nvidia.com>

[flang] Implement legacy %VAL and %REF actual arguments (#70343)

Update evaluate::ActualArgument to propagate the %VAL and %REF markers
until lowering.
Semantic checks are added to %VAL to ensure

[flang] Implement legacy %VAL and %REF actual arguments (#70343)

Update evaluate::ActualArgument to propagate the %VAL and %REF markers
until lowering.
Semantic checks are added to %VAL to ensure the argument is a numerical
or logical scalar.

I did not push these markers into the characteristics because other
compilers do not complain about inconsistent usages (e.g. using %VAL in
a call on a procedure with an interface without VALUE dummies is not
flagged by any compilers I tested, and it is not an issue for lowering,
so I decided to stay simple here and minimize the footprint of these
legacy features).

Lowering retrieves these markers and does the right thing: pass %VAL in
registers and pass %REF by address without adding any extra arguments
for characters.

show more ...


# 8c127074 28-Sep-2023 jeanPerier <jperier@nvidia.com>

[flang] Fix issues with STORAGE_SIZE and characters (#67561)

Semantics was replacing storage_size(func()) by the length specification
expression of func result (if any), which brought meaningless s

[flang] Fix issues with STORAGE_SIZE and characters (#67561)

Semantics was replacing storage_size(func()) by the length specification
expression of func result (if any), which brought meaningless symbols.
Update FunctionRef::GetType to not copy its length parameter from the
procedure designator symbol if it is not a constant expression. Note
that the deferred aspect can and must be preserved because it matters
for POINTER function results (semantics test added to ensure this).

Update lowering code to deal with characters in storage_size: simply
always call createBox to ensure the BoxEleSizeOp is legal. This will
take care of dereferencing pointers/allocatables if needed (what the
load was intended for in the previous code).

show more ...


# 72079d92 10-Aug-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Handle typeless (BOZ) arguments in AreCompatibleTypes()

The current code can crash due to the representation's use of a negative
INTEGER kind code to signify a typeless (BOZ) argument's "typ

[flang] Handle typeless (BOZ) arguments in AreCompatibleTypes()

The current code can crash due to the representation's use of a negative
INTEGER kind code to signify a typeless (BOZ) argument's "type" as a
DynamicType. Detect and handle that case, and change some direct
uses of the kind_ data member into kind() accessor references in
places that shouldn't be confronted with BOZ.

Differential Revision: https://reviews.llvm.org/D159023

show more ...


# 6bc14f23 03-Aug-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Foil attempts to require interoperable pointers be CONTIGUOUS

BIND(C) interoperable pointer descriptors may not be required to be
CONTIGUOUS in procedure interfaces.

(Also fixed erroneous t

[flang] Foil attempts to require interoperable pointers be CONTIGUOUS

BIND(C) interoperable pointer descriptors may not be required to be
CONTIGUOUS in procedure interfaces.

(Also fixed erroneous true result from IsDescriptor() predicate for
assumed-size arrays that was exposed by testing.)

Fixes llvm-test-suite/Fortran/gfortran/regression/bind_c_contiguous.f90.

Differential Revision: https://reviews.llvm.org/D157342

show more ...


# f6026f65 17-Jul-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Compare component types In AreSameComponent()

The subroutine AreSameComponent() of the predicate AreSameDerivedType()
had a TODO about checking component types that needed completion in orde

[flang] Compare component types In AreSameComponent()

The subroutine AreSameComponent() of the predicate AreSameDerivedType()
had a TODO about checking component types that needed completion in order
to properly detect that two specific procedures of a generic are
distinguishable in the llvm-test-suite/Fortran/gfortran/regression
test import7.f90.

Differential Revision: https://reviews.llvm.org/D155962

show more ...


# 3332dc32 06-May-2023 Peter Klausler <pklausler@nvidia.com>

[flang] CUDA Fortran - part 3/5: declarations checking

Implements checks for CUDA Fortran attributes on objects, types, and
subprograms. Includes a couple downgrades of existing errors into
warning

[flang] CUDA Fortran - part 3/5: declarations checking

Implements checks for CUDA Fortran attributes on objects, types, and
subprograms. Includes a couple downgrades of existing errors into
warnings that were exposed during testing.

Depends on https://reviews.llvm.org/D150159 &
https://reviews.llvm.org/D150161.

Differential Revision: https://reviews.llvm.org/D150162

show more ...


# ef934174 23-May-2023 Kelvin Li <kli@ca.ibm.com>

[flang] Support for PowerPC vector type

The following PowerPC vector type syntax is added:

VECTOR ( element-type-spec )

where element-type-sec is integer-type-spec, real-type-sec or unsigned-typ

[flang] Support for PowerPC vector type

The following PowerPC vector type syntax is added:

VECTOR ( element-type-spec )

where element-type-sec is integer-type-spec, real-type-sec or unsigned-type-spec.

Two opaque types (__VECTOR_PAIR and __VECTOR_QUAD) are also added.

A finite set of functionalities are implemented in order to support the new types:
1. declare objects
2. declare function result
3. declare type dummy arguments
4. intrinsic assignment between the new type objects (e.g. v1=v2)
5. reference functions that return the new types

Submit on behalf of @tislam @danielcchen

Authors: @tislam @danielcchen

Differential Revision: https://reviews.llvm.org/D150876

show more ...


# a88cee1f 21-Apr-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Semantics for ISO_C_BINDING's C_LOC()

Make __builtin_c_loc() into an intrinsic function and verify the
special semantic requirements on its actual arguments.

Differential Revision: https://

[flang] Semantics for ISO_C_BINDING's C_LOC()

Make __builtin_c_loc() into an intrinsic function and verify the
special semantic requirements on its actual arguments.

Differential Revision: https://reviews.llvm.org/D149988

show more ...


# d15491e9 20-Apr-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Procedure pointers are not descriptors

Code in Evaluate/type.cpp was maintaining a very old assumption that
procedure pointers would need to be represented as descriptors. This
is not the c

[flang] Procedure pointers are not descriptors

Code in Evaluate/type.cpp was maintaining a very old assumption that
procedure pointers would need to be represented as descriptors. This
is not the case -- they are code or thunk addresses.

Differential Revision: https://reviews.llvm.org/D149984

show more ...


# 78f19d9b 20-Apr-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Relax two !DIR$ IGNORE_TKR error cases with descriptor arguments

Allow two currently erroneous cases of !DIR$ IGNORE_TKR errors: allocatable
and pointers, and IGNORE_TKR(R) on (other) argume

[flang] Relax two !DIR$ IGNORE_TKR error cases with descriptor arguments

Allow two currently erroneous cases of !DIR$ IGNORE_TKR errors: allocatable
and pointers, and IGNORE_TKR(R) on (other) arguments passed via descriptors.
Downgrade these cases to warnings when they appear in external interfaces,
since their implementations may well be in C. But retain the error status
on these cases for module procedures, since the Fortran implementation
probably can't work.

Differential Revision: https://reviews.llvm.org/D148833

show more ...


# 864cb2aa 10-Apr-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Semantics for !DIR$ IGNORE_TKR

Implement semantics for the IGNORE_TKR directive as it is interpreted
by the PGI / NVFORTRAN compiler.

Differential Revision: https://reviews.llvm.org/D148643


# a94083b5 10-Mar-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Break shared library cyclic dependence

I inadvertently introduced a cycle of dependences between the Evaluate
and Semantics libraries; this patch breaks that cycle and reenables
the flang bu

[flang] Break shared library cyclic dependence

I inadvertently introduced a cycle of dependences between the Evaluate
and Semantics libraries; this patch breaks that cycle and reenables
the flang build bots that rely on shared library builds.

show more ...


# d84faa42 02-Mar-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Ignore FINAL subroutines with mismatching type parameters

When a parameterized derived type has FINAL subroutines, only
those FINAL subroutines whose dummy argument's type matches the
type p

[flang] Ignore FINAL subroutines with mismatching type parameters

When a parameterized derived type has FINAL subroutines, only
those FINAL subroutines whose dummy argument's type matches the
type parameter values of a particular instantiation are relevant
to that instantiation.

Differential Revision: https://reviews.llvm.org/D145741

show more ...


# e6be8da1 02-Mar-2023 Peter Klausler <pklausler@nvidia.com>

[flang] Fix crash in folding TRANSFER() with MOLD=substring

When a substring appears as the MOLD= argument to TRANSFER(),
it's possible for the compiler to assert if it can't figure
out a constant l

[flang] Fix crash in folding TRANSFER() with MOLD=substring

When a substring appears as the MOLD= argument to TRANSFER(),
it's possible for the compiler to assert if it can't figure
out a constant length for the substring. Fix.

Differential Revision: https://reviews.llvm.org/D145740

show more ...


123