[flang-commits] [flang] [mlir] [flang][AIX] BIND(C) derived type alignment for AIX (PR #121505)

Kelvin Li via flang-commits flang-commits at lists.llvm.org
Thu Jan 2 15:24:07 PST 2025


================
@@ -65,6 +70,60 @@ class ComputeOffsetsHelper {
       equivalenceBlock_;
 };
 
+static bool isReal8OrLarger(const Fortran::semantics::DeclTypeSpec *type) {
+  return ((type->IsNumeric(common::TypeCategory::Real) ||
+              type->IsNumeric(common::TypeCategory::Complex)) &&
+      evaluate::ToInt64(type->numericTypeSpec().kind()) > 4);
+}
+
+std::optional<size_t> ComputeOffsetsHelper::CompAlignment(const Symbol &sym) {
+  size_t max_align{0};
+  bool contain_double{false};
+  const auto derivedTypeSpec{sym.GetType()->AsDerived()};
+  DirectComponentIterator directs{*derivedTypeSpec};
+  for (auto it = directs.begin(); it != directs.end(); ++it) {
----------------
kkwli wrote:

Fixed

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


More information about the flang-commits mailing list