<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/flang/lib/Semantics/pointer-assignment.cpp, branch users/mingmingl-llvm/samplefdo-profile-format</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[flang] Consolidate copy-in/copy-out determination in evaluate framework (#151408)</title>
<updated>2025-08-26T22:40:13+00:00</updated>
<author>
<name>Eugene Epshteyn</name>
<email>eepshteyn@nvidia.com</email>
</author>
<published>2025-08-26T22:40:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4b6a4aa5228a45c3ab2add631f9dd49777b5bf24'/>
<id>4b6a4aa5228a45c3ab2add631f9dd49777b5bf24</id>
<content type='text'>
New implementation of `MayNeedCopy()` is used to consolidate
copy-in/copy-out checks.

`IsAssumedShape()` and `IsAssumedRank()` were simplified and are both
now in `Fortran::semantics` workspace.

`preparePresentUserCallActualArgument()` in lowering was modified to use
`MayNeedCopyInOut()`

Fixes https://github.com/llvm/llvm-project/issues/138471</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
New implementation of `MayNeedCopy()` is used to consolidate
copy-in/copy-out checks.

`IsAssumedShape()` and `IsAssumedRank()` were simplified and are both
now in `Fortran::semantics` workspace.

`preparePresentUserCallActualArgument()` in lowering was modified to use
`MayNeedCopyInOut()`

Fixes https://github.com/llvm/llvm-project/issues/138471</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][near NFC] Fix English in an error message (#151029)</title>
<updated>2025-07-30T18:41:57+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>pklausler@nvidia.com</email>
</author>
<published>2025-07-30T18:41:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=13b2fc1b9d04065d542acc0dd357865febfd3377'/>
<id>13b2fc1b9d04065d542acc0dd357865febfd3377</id>
<content type='text'>
Correct "is a not a pointer" to "is not a pointer" in an error message.
While here, also unsplit nearby error messages so that their contents
are more searchable.

Fixes https://github.com/llvm/llvm-project/issues/150864.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Correct "is a not a pointer" to "is not a pointer" in an error message.
While here, also unsplit nearby error messages so that their contents
are more searchable.

Fixes https://github.com/llvm/llvm-project/issues/150864.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Require contiguous actual pointer for contiguous dummy pointer (#139298)</title>
<updated>2025-05-12T19:27:21+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>pklausler@nvidia.com</email>
</author>
<published>2025-05-12T19:27:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1d8ecbe9486b8a6b2839cb3001008338c3d9798d'/>
<id>1d8ecbe9486b8a6b2839cb3001008338c3d9798d</id>
<content type='text'>
When the actual argument associated with an explicitly CONTIGUOUS
pointer dummy argument is itself a pointer, it must also be contiguous.
(A non-pointer actual argument can associate with a CONTIGUOUS pointer
dummy argument if it's INTENT(IN), and in that case it's still just a
warning if we can't prove at compilation time that the actual is
contiguous.)

Fixes https://github.com/llvm/llvm-project/issues/138899.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the actual argument associated with an explicitly CONTIGUOUS
pointer dummy argument is itself a pointer, it must also be contiguous.
(A non-pointer actual argument can associate with a CONTIGUOUS pointer
dummy argument if it's INTENT(IN), and in that case it's still just a
warning if we can't prove at compilation time that the actual is
contiguous.)

Fixes https://github.com/llvm/llvm-project/issues/138899.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][volatile] Get volatility of designators from base instead of component symbol (#138611)</title>
<updated>2025-05-10T00:20:56+00:00</updated>
<author>
<name>Andre Kuhlenschmidt</name>
<email>andre.kuhlenschmidt@gmail.com</email>
</author>
<published>2025-05-10T00:20:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d21534f482f21356531f25671b18ae385e04c296'/>
<id>d21534f482f21356531f25671b18ae385e04c296</id>
<content type='text'>
The standard says in [8.5.20 VOLATILE attribute]:
If an object has the VOLATILE attribute, then all of its sub-objects
also have the VOLATILE attribute.

This code takes this into account and uses the volatility of the base of
the designator instead of that of the component. In fact, fields in a
structure are not allowed to have the volatile attribute. So given the
code, `A%B =&gt; t`, symbol `B` could never directly have the volatile
attribute, and the volatility of `A` indicates the volatility of `B`.


This PR should address [the
comments](https://github.com/llvm/llvm-project/pull/132486#issuecomment-2851313119)
on this PR #132486</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The standard says in [8.5.20 VOLATILE attribute]:
If an object has the VOLATILE attribute, then all of its sub-objects
also have the VOLATILE attribute.

This code takes this into account and uses the volatility of the base of
the designator instead of that of the component. In fact, fields in a
structure are not allowed to have the volatile attribute. So given the
code, `A%B =&gt; t`, symbol `B` could never directly have the volatile
attribute, and the volatility of `A` indicates the volatility of `B`.


This PR should address [the
comments](https://github.com/llvm/llvm-project/pull/132486#issuecomment-2851313119)
on this PR #132486</pre>
</div>
</content>
</entry>
<entry>
<title>[flang][frontend] warn when a volatile target is pointer associated with an non-volatile pointer (#136778)</title>
<updated>2025-05-01T20:45:13+00:00</updated>
<author>
<name>Andre Kuhlenschmidt</name>
<email>andre.kuhlenschmidt@gmail.com</email>
</author>
<published>2025-05-01T20:45:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=42f5d716cbb8b391203eb880ac81f6272fd611f1'/>
<id>42f5d716cbb8b391203eb880ac81f6272fd611f1</id>
<content type='text'>
closes #135805</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes #135805</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Catch C15104(4) violations when coindexing is present (#130677)</title>
<updated>2025-03-19T18:58:59+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>pklausler@nvidia.com</email>
</author>
<published>2025-03-19T18:58:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=587f997db73aa0aab34a4e5e0ad5db6779cd9351'/>
<id>587f997db73aa0aab34a4e5e0ad5db6779cd9351</id>
<content type='text'>
The value of a structure constructor component can't have a pointer
ultimate component if it is a coindexed designator.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The value of a structure constructor component can't have a pointer
ultimate component if it is a coindexed designator.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Enforce C1027 (F'2023) (#129617)</title>
<updated>2025-03-10T20:16:50+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>pklausler@nvidia.com</email>
</author>
<published>2025-03-10T20:16:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=706e7d83cfd92c9da5125c43a28832336e9bd45b'/>
<id>706e7d83cfd92c9da5125c43a28832336e9bd45b</id>
<content type='text'>
The LHS of a pointer assignment statement may not be coindexed.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The LHS of a pointer assignment statement may not be coindexed.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Further work on NULL(MOLD=allocatable) (#129345)</title>
<updated>2025-03-03T22:46:35+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>pklausler@nvidia.com</email>
</author>
<published>2025-03-03T22:46:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=79a25e11fe119520e7cb70118df18e199217c891'/>
<id>79a25e11fe119520e7cb70118df18e199217c891</id>
<content type='text'>
Refine handling of NULL(...) in semantics to properly distinguish
NULL(), NULL(objectPointer), NULL(procPointer), and NULL(allocatable)
from each other in relevant contexts.

Add IsNullAllocatable() and IsNullPointerOrAllocatable() utility
functions. IsNullAllocatable() is true only for NULL(allocatable); it is
false for a bare NULL(), which can be detected independently with
IsBareNullPointer().

IsNullPointer() now returns false for NULL(allocatable).

ALLOCATED(NULL(allocatable)) now works, and folds to .FALSE.

These utilities were modified to accept const pointer arguments rather
than const references; I usually prefer this style when the result
should clearly be false for a null argument (in the C sense), and it
helped me find all of their use sites in the code.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refine handling of NULL(...) in semantics to properly distinguish
NULL(), NULL(objectPointer), NULL(procPointer), and NULL(allocatable)
from each other in relevant contexts.

Add IsNullAllocatable() and IsNullPointerOrAllocatable() utility
functions. IsNullAllocatable() is true only for NULL(allocatable); it is
false for a bare NULL(), which can be detected independently with
IsBareNullPointer().

IsNullPointer() now returns false for NULL(allocatable).

ALLOCATED(NULL(allocatable)) now works, and folds to .FALSE.

These utilities were modified to accept const pointer arguments rather
than const references; I usually prefer this style when the result
should clearly be false for a null argument (in the C sense), and it
helped me find all of their use sites in the code.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Better handling of weird pointer assignment case (#120628)</title>
<updated>2025-01-08T21:12:00+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>pklausler@nvidia.com</email>
</author>
<published>2025-01-08T21:12:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b8513e439351b11a90b8aa69311cf57572405826'/>
<id>b8513e439351b11a90b8aa69311cf57572405826</id>
<content type='text'>
F'2023 C1017 permits the assignment of an unlimited polymorphic data
target to a monomorphic LHS pointer when the LHS pointer has a sequence
derived type (BIND(C) or SEQUENCE attribute). We allowed for this in
pointer assignments that don't have a function reference as their RHS.
Extend this support to function references, and also ensure that rank
compatibility is still checked.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
F'2023 C1017 permits the assignment of an unlimited polymorphic data
target to a monomorphic LHS pointer when the LHS pointer has a sequence
derived type (BIND(C) or SEQUENCE attribute). We allowed for this in
pointer assignments that don't have a function reference as their RHS.
Extend this support to function references, and also ensure that rank
compatibility is still checked.</pre>
</div>
</content>
</entry>
<entry>
<title>[flang] Tag warnings with LanguageFeature or UsageWarning (#110304)</title>
<updated>2024-10-02T15:54:49+00:00</updated>
<author>
<name>Peter Klausler</name>
<email>pklausler@nvidia.com</email>
</author>
<published>2024-10-02T15:54:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0f973ac783aa100cfbce1cd2c6e8a3a8f648fae7'/>
<id>0f973ac783aa100cfbce1cd2c6e8a3a8f648fae7</id>
<content type='text'>
(This is a big patch, but it's nearly an NFC. No test results have
changed and all Fortran tests in the LLVM test suites work as expected.)

Allow a parser::Message for a warning to be marked with the
common::LanguageFeature or common::UsageWarning that controls it. This
will allow a later patch to add hooks whereby a driver will be able to
decorate warning messages with the names of its options that enable each
particular warning, and to add hooks whereby a driver can map those
enumerators by name to command-line options that enable/disable the
language feature and enable/disable the messages.

The default settings in the constructor for LanguageFeatureControl were
moved from its header file into its C++ source file.

Hooks for a driver to use to map the name of a feature or warning to its
enumerator were also added.

To simplify the tagging of warnings with their corresponding language
feature or usage warning, to ensure that they are properly controlled by
ShouldWarn(), and to ensure that warnings never issue at code sites in
module files, two new Warn() member function templates were added to
SemanticsContext and other contextual frameworks. Warn() can't be used
before source locations can be mapped to scopes, but the bulk of
existing code blocks testing ShouldWarn() and FindModuleFile() before
calling Say() were convertible into calls to Warn(). The ones that were
not convertible were extended with explicit calls to
Message::set_languageFeature() and set_usageWarning().</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(This is a big patch, but it's nearly an NFC. No test results have
changed and all Fortran tests in the LLVM test suites work as expected.)

Allow a parser::Message for a warning to be marked with the
common::LanguageFeature or common::UsageWarning that controls it. This
will allow a later patch to add hooks whereby a driver will be able to
decorate warning messages with the names of its options that enable each
particular warning, and to add hooks whereby a driver can map those
enumerators by name to command-line options that enable/disable the
language feature and enable/disable the messages.

The default settings in the constructor for LanguageFeatureControl were
moved from its header file into its C++ source file.

Hooks for a driver to use to map the name of a feature or warning to its
enumerator were also added.

To simplify the tagging of warnings with their corresponding language
feature or usage warning, to ensure that they are properly controlled by
ShouldWarn(), and to ensure that warnings never issue at code sites in
module files, two new Warn() member function templates were added to
SemanticsContext and other contextual frameworks. Warn() can't be used
before source locations can be mapped to scopes, but the bulk of
existing code blocks testing ShouldWarn() and FindModuleFile() before
calling Say() were convertible into calls to Warn(). The ones that were
not convertible were extended with explicit calls to
Message::set_languageFeature() and set_usageWarning().</pre>
</div>
</content>
</entry>
</feed>
