[Mlir-commits] [flang] [mlir] [flang] Add debug information for module variables. (PR #91582)

Abid Qadeer llvmlistbot at llvm.org
Thu May 9 08:09:51 PDT 2024


================
@@ -1030,10 +1030,15 @@ LogicalResult ModuleTranslation::convertGlobals() {
       llvm::DIGlobalVariable *diGlobalVar = diGlobalExpr->getVariable();
       var->addDebugInfo(diGlobalExpr);
 
+      // For fortran, the scope hierarchy can be
+      // variable -> module -> compile unit
+      llvm::DIScope *scope = diGlobalVar->getScope();
+      if (llvm::DIModule *mod = dyn_cast_if_present<llvm::DIModule>(scope))
+        scope = mod->getScope();
+
----------------
abidh wrote:

Thanks for letting me know. I have now opened #91604 with this change and a testcase. I will remove this bit from this PR.

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


More information about the Mlir-commits mailing list