[Mlir-commits] [mlir] [MLIR][LLVM] Add DILocAttr for debug locations (PR #186146)
Aman LaChapelle
llvmlistbot at llvm.org
Thu Mar 12 13:54:01 PDT 2026
================
@@ -87,54 +92,58 @@ static void addScopeToFunction(LLVM::LLVMFuncOp llvmFunc,
fileAttr,
/*line=*/line, /*scopeLine=*/line, subprogramFlags, subroutineTypeAttr,
/*retainedNodes=*/{}, /*annotations=*/{});
- llvmFunc->setLoc(FusedLoc::get(context, {loc}, subprogramAttr));
+ FileLineColLoc fileLoc = extractFileLoc(loc);
+ if (!fileLoc)
+ fileLoc = FileLineColLoc::get(context, "<unknown>", line, /*column=*/0);
----------------
bzcheeseman wrote:
If you pass an empty string here, FileLineColLoc will use a standard `"-"` string, which IMO is preferable in this case.
https://github.com/llvm/llvm-project/pull/186146
More information about the Mlir-commits
mailing list