[flang][debug] Emit DW_TAG_inlined_subroutine and DW_AT_inline for inlined functions
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Consider the following minimal reproducer code,
```fortran
subroutine callee(x)
integer, intent(inout) :: x
x = x + 1
end subroutine
program main
integer :: val = 10
call callee(val)
print *, val
end program
```
With `gfortran -O2 -finline-functions -g`, the DWARF dump contains the following inlining related information,
`DW_TAG_inlined_subroutine` with `DW_AT_abstract_origin`
`DW_AT_inline: 1 (inlined)` on the original subroutine
`DW_AT_call_file: 1`, `DW_AT_call_line: 8` which are the call site location info
With `flang -O2 -finline-functions -g`, the DWARF only has the subroutine name - no inline tracking.
These debug information are useful and needed when profiling the program.
Contributor guide
Assessment
This issue has not been assessed yet.