[flang-commits] [flang] [llvm] [flang] To fix LIT test that AIX does not emit comdat. (PR #214950)

via flang-commits flang-commits at lists.llvm.org
Sat Aug 8 16:19:29 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 -- flang-rt/lib/runtime/derived-api.cpp flang/lib/Lower/Allocatable.cpp flang/lib/Lower/Bridge.cpp flang/lib/Lower/ConvertType.cpp flang/lib/Optimizer/CodeGen/CodeGen.cpp flang/lib/Optimizer/Dialect/FIRType.cpp flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.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-rt/lib/runtime/derived-api.cpp b/flang-rt/lib/runtime/derived-api.cpp
index 465502295..d7e9d0619 100644
--- a/flang-rt/lib/runtime/derived-api.cpp
+++ b/flang-rt/lib/runtime/derived-api.cpp
@@ -113,15 +113,13 @@ bool RTDEF(SameTypeAs)(const Descriptor &a, const Descriptor &b) {
         if (uninstDerivedTypeA != uninstDerivedTypeB)
           return false;
         // Same uninstantiated template -- reject if it is an IBM vector type.
-        static constexpr char vecPrefix[] =
-            "__builtin_ppc_intrinsic_vector";
+        static constexpr char vecPrefix[] = "__builtin_ppc_intrinsic_vector";
         static constexpr std::size_t vecPrefixLen{sizeof(vecPrefix) - 1};
         const Descriptor &nameDesc{uninstDerivedTypeA->name()};
         const char *typeName{nameDesc.OffsetElement<const char>()};
         std::size_t nameLen{nameDesc.ElementBytes()};
         if (nameLen >= vecPrefixLen &&
-            Fortran::runtime::memcmp(
-                typeName, vecPrefix, vecPrefixLen) == 0)
+            Fortran::runtime::memcmp(typeName, vecPrefix, vecPrefixLen) == 0)
           // IBM vector types: same template but different KIND -- distinct.
           return false;
         return true;
diff --git a/flang/lib/Lower/Allocatable.cpp b/flang/lib/Lower/Allocatable.cpp
index ecc965720..2a92d3d84 100644
--- a/flang/lib/Lower/Allocatable.cpp
+++ b/flang/lib/Lower/Allocatable.cpp
@@ -233,8 +233,7 @@ static mlir::Value genVectorMoldBox(fir::FirOpBuilder &builder,
   // are emitted after the function body and not yet present.
   std::string recName =
       "_QM__ppc_typesT__builtin_ppc_intrinsic_vector" + kSuffix;
-  fir::RecordType recTy =
-      fir::RecordType::get(builder.getContext(), recName);
+  fir::RecordType recTy = fir::RecordType::get(builder.getContext(), recName);
   if (!recTy)
     return {};
   // fir.embox requires a data pointer, not a descriptor value.
@@ -245,8 +244,8 @@ static mlir::Value genVectorMoldBox(fir::FirOpBuilder &builder,
           fir::unwrapPassByRefType(dataAddr.getType())))
     seqTy = fir::SequenceType::get(arrTy.getShape(), recTy);
   else
-    seqTy = fir::SequenceType::get({fir::SequenceType::getUnknownExtent()},
-                                   recTy);
+    seqTy =
+        fir::SequenceType::get({fir::SequenceType::getUnknownExtent()}, recTy);
   // createShape returns {} for a BoxValue with no explicit lower bounds;
   // fall back to reading extents from the box (constants or fir.box_dims).
   mlir::Value shape = builder.createShape(loc, mold);
diff --git a/flang/lib/Lower/ConvertType.cpp b/flang/lib/Lower/ConvertType.cpp
index dd4e8485d..c04ec2cee 100644
--- a/flang/lib/Lower/ConvertType.cpp
+++ b/flang/lib/Lower/ConvertType.cpp
@@ -391,7 +391,8 @@ struct TypeBuilderImpl {
                 scope->runtimeDerivedTypeDescription()) {
           mlir::Location loc =
               converter.genLocation(tySpec.typeSymbol().name());
-          auto rec = fir::RecordType::get(context, converter.mangleName(tySpec));
+          auto rec =
+              fir::RecordType::get(context, converter.mangleName(tySpec));
           if (!rec.isFinalized())
             rec.finalize({}, {}); // empty: no Fortran components, no len params
           converter.registerTypeInfo(loc, *typeInfoSym, tySpec, rec);

``````````

</details>


https://github.com/llvm/llvm-project/pull/214950


More information about the flang-commits mailing list