[flang-commits] [flang] [flang][debug] Support assumed shape arrays. (PR #94644)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Fri Jun 7 03:09:48 PDT 2024
================
@@ -22,6 +26,60 @@ namespace fir {
DebugTypeGenerator::DebugTypeGenerator(mlir::ModuleOp m)
: module(m), kindMapping(getKindMapping(m)) {
LLVM_DEBUG(llvm::dbgs() << "DITypeAttr generator\n");
+
+ std::optional<mlir::DataLayout> dl =
+ fir::support::getOrSetDataLayout(module, /*allowDefaultLayout=*/true);
+ if (!dl)
+ mlir::emitError(module.getLoc(), "Missing data layout attribute in module");
----------------
tblah wrote:
nit: it would be better to return early after emitting the error so that we don't crash when dereferencing `dl`.
https://github.com/llvm/llvm-project/pull/94644
More information about the flang-commits
mailing list