[Mlir-commits] [mlir] [mlir][flang] Improve handling of fortran module variables. (PR #91604)

Abid Qadeer llvmlistbot at llvm.org
Mon May 13 02:50:45 PDT 2024


================
@@ -1029,11 +1029,17 @@ LogicalResult ModuleTranslation::convertGlobals() {
           debugTranslation->translateGlobalVariableExpression(op.getDbgExpr());
       llvm::DIGlobalVariable *diGlobalVar = diGlobalExpr->getVariable();
       var->addDebugInfo(diGlobalExpr);
+      // For fortran, the scope hierarchy can be
+      // variable -> module -> compile unit
+      // If a variable scope points to Module then we get its parent scope so
+      // that globals get added to the compile unit.
+      llvm::DIScope *scope = diGlobalVar->getScope();
----------------
abidh wrote:

I have updated the comments.

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


More information about the Mlir-commits mailing list