[flang-commits] [flang] [flang][debug] Generate DWARF debug info using fir.use_stmt. (PR #168541)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Wed Jan 14 09:45:14 PST 2026


================
@@ -662,6 +700,104 @@ void AddDebugInfoPass::handleFuncOp(mlir::func::FuncOp funcOp,
   commonBlockMap.clear();
 }
 
+// Process USE with ONLY clause
+void AddDebugInfoPass::handleOnlyClause(
+    fir::UseStmtOp useOp, mlir::LLVM::DISubprogramAttr spAttr,
+    mlir::LLVM::DIFileAttr fileAttr, mlir::SymbolTable *symbolTable,
+    llvm::DenseSet<mlir::LLVM::DIImportedEntityAttr> &importedModules) {
+  mlir::MLIRContext *context = &getContext();
+
+  auto createImportedDecl = [&](llvm::StringRef symbolName,
----------------
tblah wrote:

nit: roughly the same code appears in handleRenamesWithoutOnly. Maybe this could be factored out into a helper?

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


More information about the flang-commits mailing list