[flang-commits] [flang] [flang] Carry over alignment computed by frontend for COMMON (PR #94280)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Tue Jun 4 02:34:32 PDT 2024


================
@@ -1307,7 +1307,10 @@ declareCommonBlock(Fortran::lower::AbstractConverter &converter,
     auto vecTy = mlir::VectorType::get(sz, i8Ty);
     mlir::Attribute zero = builder.getIntegerAttr(i8Ty, 0);
     auto init = mlir::DenseElementsAttr::get(vecTy, llvm::ArrayRef(zero));
-    builder.createGlobal(loc, commonTy, commonName, linkage, init);
+    global = builder.createGlobal(loc, commonTy, commonName, linkage, init);
+    if (const auto *details =
+            common.detailsIf<Fortran::semantics::CommonBlockDetails>())
----------------
kiranchandramohan wrote:

Nit: Is this always true? Should it be an assert?

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


More information about the flang-commits mailing list