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

via flang-commits flang-commits at lists.llvm.org
Mon May 20 02:52:26 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 72a895336b1e4df1ec2f485f8786ead6c356edb8 4b6d76859828327da1b5999531a4ab3b58ccb5c0 -- flang/lib/Optimizer/CodeGen/CodeGen.cpp flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp b/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
index cf1bbda40c..fb7c0bf0d1 100644
--- a/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+++ b/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
@@ -122,7 +122,8 @@ mlir::LLVM::DIModuleAttr AddDebugInfoPass::getOrCreateModuleAttr(
   } else {
     modAttr = mlir::LLVM::DIModuleAttr::get(
         context, fileAttr, scope, mlir::StringAttr::get(context, name),
-        /* configMacros */ mlir::StringAttr(), /* includePath */mlir::StringAttr(),
+        /* configMacros */ mlir::StringAttr(),
+        /* includePath */ mlir::StringAttr(),
         /* apinotes */ mlir::StringAttr(), line, decl);
     moduleMap[name] = modAttr;
   }
@@ -162,8 +163,8 @@ void AddDebugInfoPass::handleGlobalOp(fir::GlobalOp globalOp,
   scope = getOrCreateModuleAttr(result.second.modules[0], fileAttr, scope,
                                 line - 1, !globalOp.isInitialized());
 
-  mlir::LLVM::DITypeAttr diType = typeGen.convertType(globalOp.getType(), fileAttr, scope,
-                                    globalOp.getLoc());
+  mlir::LLVM::DITypeAttr diType = typeGen.convertType(
+      globalOp.getType(), fileAttr, scope, globalOp.getLoc());
   auto gvAttr = mlir::LLVM::DIGlobalVariableAttr::get(
       context, scope, mlir::StringAttr::get(context, result.second.name),
       mlir::StringAttr::get(context, globalOp.getName()), fileAttr, line,

``````````

</details>


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


More information about the flang-commits mailing list