[llvm] [flang][runtime] fix intrinsics case of extends_type_of (PR #161466)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 30 17:48:02 PDT 2025
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 h,cpp -- flang-rt/include/flang-rt/runtime/descriptor.h flang-rt/lib/runtime/derived-api.cpp flang-rt/lib/runtime/pointer.cpp
``````````
: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-rt/include/flang-rt/runtime/descriptor.h b/flang-rt/include/flang-rt/runtime/descriptor.h
index d34eb326d..d1a0eaaad 100644
--- a/flang-rt/include/flang-rt/runtime/descriptor.h
+++ b/flang-rt/include/flang-rt/runtime/descriptor.h
@@ -227,9 +227,7 @@ public:
RT_API_ATTRS bool IsPointer() const {
return raw_.attribute == CFI_attribute_pointer;
}
- RT_API_ATTRS bool IsAssociated() const {
- return raw_.base_addr != nullptr;
- }
+ RT_API_ATTRS bool IsAssociated() const { return raw_.base_addr != nullptr; }
RT_API_ATTRS bool IsAllocatable() const {
return raw_.attribute == CFI_attribute_allocatable;
}
diff --git a/flang-rt/lib/runtime/derived-api.cpp b/flang-rt/lib/runtime/derived-api.cpp
index 31b5333ea..bca4fe76c 100644
--- a/flang-rt/lib/runtime/derived-api.cpp
+++ b/flang-rt/lib/runtime/derived-api.cpp
@@ -124,7 +124,7 @@ bool RTDEF(ExtendsTypeOf)(const Descriptor &a, const Descriptor &mold) {
// F'23 16.9.86 p 5
// If MOLD is unlimited polymorphic and is either a disassociated pointer or
// unallocated allocatable variable, the result is true;
- if ((mold.IsPointer() && !mold.IsAssociated()) ||
+ if ((mold.IsPointer() && !mold.IsAssociated()) ||
(mold.IsAllocatable() && !mold.IsAllocated())) {
return true;
} else if ((a.IsPointer() && !mold.IsAssociated()) ||
@@ -139,22 +139,22 @@ bool RTDEF(ExtendsTypeOf)(const Descriptor &a, const Descriptor &mold) {
// true if and only if the dynamic type of A is an extension type of the
// dynamic type of MOLD.
for (const typeInfo::DerivedType *derivedTypeA{GetDerivedType(a)};
- derivedTypeA; derivedTypeA = derivedTypeA->GetParentType()) {
- if (derivedTypeA == derivedTypeMold) {
- return true;
- }
+ derivedTypeA; derivedTypeA = derivedTypeA->GetParentType()) {
+ if (derivedTypeA == derivedTypeMold) {
+ return true;
+ }
}
return false;
}
// MOLD is unlimited polymorphic and unallocated/disassociated.
- // This might be impossible to reach since the case is now handled explicitly
- // above.
+ // This might be impossible to reach since the case is now handled
+ // explicitly above.
return true;
} else {
// F'23: otherwise, the result is processor dependent.
// extension, if types are not extensible, true if they match.
- return aType != CFI_type_other && moldType != CFI_type_other &&
- aType == moldType;
+ return aType != CFI_type_other && moldType != CFI_type_other &&
+ aType == moldType;
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/161466
More information about the llvm-commits
mailing list