[all-commits] [llvm/llvm-project] 7ecac8: [flang][debug] Emit debug info for procedures from...
Abid Qadeer via All-commits
all-commits at lists.llvm.org
Wed Sep 23 01:44:22 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7ecac8052859d14cc71b08fafdb4100d26eeaa4d
https://github.com/llvm/llvm-project/commit/7ecac8052859d14cc71b08fafdb4100d26eeaa4d
Author: Abid Qadeer <haqadeer at amd.com>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M flang/include/flang/Optimizer/Support/Utils.h
M flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
M flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
A flang/test/Integration/debug-include-file.f90
M flang/test/Integration/debug-module-2.f90
M flang/test/Integration/debug-module-constant.f90
M flang/test/Transforms/debug-derived-type-1.fir
M flang/test/Transforms/debug-dummy-argument-inline.fir
A flang/test/Transforms/debug-include-file.fir
Log Message:
-----------
[flang][debug] Emit debug info for procedures from an INCLUDE'd file. (#225068)
A declaration read through INCLUDE gets a location that is fused with
the inclusion information, carrying a fir::LocationKindArrayAttr.
debugInfoIsAlreadySet treated any fused location as one this pass had
already handled, apart from a fir::LocationKindAttr that is never the
attribute actually used, so handleFuncOp and handleGlobalOp returned
immediately and such a procedure or global got no debug information at
all.
Examine what the fusion holds instead of only whether there is one. The
attribute to look for is now a template argument, so each caller names
the one it would attach itself, a DISubprogramAttr for a function and an
array of DIGlobalVariableExpressionAttr for a global, and no central
list has to be kept in step with them.
Doing only that describes the procedure at the line of the INCLUDE
statement rather than at its own, because the file and line are read
with a cast that a fused location does not satisfy, leaving them at the
compile unit's file and at line 1. Search the location for the
FileLineColLoc in both places instead. Searching it also gives a
variable inlined from another procedure the line it is declared on
rather than that same fallback of 1, which is what changes in
debug-dummy-argument-inline.fir.
---------
Co-authored-by: Cursor <cursoragent at cursor.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list