Issue 176042
Summary [flang][debug] Emit DW_TAG_inlined_subroutine and DW_AT_inline for inlined functions
Labels flang
Assignees
Reporter jiel-nv
    Consider the following minimal reproducer code,

```
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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to