[flang-commits] [flang] [flang][debug] Add support for common blocks. (PR #112398)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Thu Oct 17 04:09:53 PDT 2024


================
@@ -90,6 +105,67 @@ bool debugInfoIsAlreadySet(mlir::Location loc) {
 
 } // namespace
 
+bool AddDebugInfoPass::createCommonBlockGlobal(
+    fir::cg::XDeclareOp declOp, const std::string &name,
+    mlir::LLVM::DIFileAttr fileAttr, mlir::LLVM::DIScopeAttr scopeAttr,
+    fir::DebugTypeGenerator &typeGen, mlir::SymbolTable *symbolTable) {
+  mlir::MLIRContext *context = &getContext();
+  mlir::OpBuilder builder(context);
+  std::optional<std::int64_t> optint;
+  auto op = declOp.getMemref().getDefiningOp();
----------------
tblah wrote:

nit: Usual flang style is to spell out types where these are not stated in the initializer for the variable.

For example, `auto sym = addrOfOp.getSymbol()` should spell out the type of `sym`, but `auto conOp = mlir::dyn_cast_if_present<fir::convertOp>(op)` already makes the type clear.

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


More information about the flang-commits mailing list