[flang-commits] [flang] [flang] Associate named constant actual arguments with their storage (PR #222986)
via flang-commits
flang-commits at lists.llvm.org
Wed Sep 23 00:24:52 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- flang/include/flang/Evaluate/check-expression.h flang/include/flang/Evaluate/fold-designator.h flang/lib/Evaluate/check-expression.cpp flang/lib/Evaluate/fold-designator.cpp flang/lib/Evaluate/fold-implementation.h flang/lib/Evaluate/fold.cpp flang/lib/Evaluate/intrinsics.cpp flang/lib/Evaluate/shape.cpp flang/lib/Lower/ConvertCall.cpp flang/lib/Semantics/check-call.cpp flang/lib/Semantics/expression.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/flang/lib/Evaluate/shape.cpp b/flang/lib/Evaluate/shape.cpp
index cff059ba7..bce4e2d61 100644
--- a/flang/lib/Evaluate/shape.cpp
+++ b/flang/lib/Evaluate/shape.cpp
@@ -305,8 +305,8 @@ public:
} else if (IsImpliedShape(symbol) && object->init()) {
// Implied-shape named constant: there is no explicit upper
// bound, but the extent is known from the initializer.
- if (auto extent{ToInt64(
- GetExtent(base, dimension_, invariantOnly_))}) {
+ if (auto extent{
+ ToInt64(GetExtent(base, dimension_, invariantOnly_))}) {
if (*extent <= 0) {
return Result{1};
}
diff --git a/flang/lib/Lower/ConvertCall.cpp b/flang/lib/Lower/ConvertCall.cpp
index 19c354b6e..3493f562b 100644
--- a/flang/lib/Lower/ConvertCall.cpp
+++ b/flang/lib/Lower/ConvertCall.cpp
@@ -1395,16 +1395,14 @@ static PreparedDummyArgument preparePresentUserCallActualArgument(
// in contexts that do not use the copy-in/copy-out machinery.
Fortran::evaluate::FoldingContext &foldingContext{
callContext.converter.getFoldingContext()};
- const bool suggestCopyIn{
- Fortran::evaluate::ActualArgNeedsCopy(arg.entity, arg.characteristics,
- foldingContext,
- /*forCopyOut=*/false)
- .value_or(true)};
- const bool suggestCopyOut{
- Fortran::evaluate::ActualArgNeedsCopy(arg.entity, arg.characteristics,
- foldingContext,
- /*forCopyOut=*/true)
- .value_or(true)};
+ const bool suggestCopyIn{Fortran::evaluate::ActualArgNeedsCopy(
+ arg.entity, arg.characteristics, foldingContext,
+ /*forCopyOut=*/false)
+ .value_or(true)};
+ const bool suggestCopyOut{Fortran::evaluate::ActualArgNeedsCopy(
+ arg.entity, arg.characteristics, foldingContext,
+ /*forCopyOut=*/true)
+ .value_or(true)};
bool mustDoCopyIn{false};
bool mustDoCopyOut{false};
if (callContext.doCopyIn) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/222986
More information about the flang-commits
mailing list