mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 17:36:36 +00:00

Recent changes to MLIR meant that Flang does not generate any debug line table information. This patch adds a pass that provides some foundation work with which basic line table debug info can be generated. A walk is performed on all the `func` ops in the module and they are decorated with a fusedLoc op that contains the debug metadata for the subroutine along with location information. Alternatives include populating this info during lowering or during FIR to LLVM Dialect conversion. Note: Patches in future will add -> more realistic debug info for types and other fields. -> driver flags to control generation of debug. Fixes #58634. Reviewed By: awarzynski, vzakhari Differential Revision: https://reviews.llvm.org/D137956
13 lines
346 B
Fortran
13 lines
346 B
Fortran
! Test that the module has the location information
|
|
|
|
! RUN: %flang_fc1 -mmlir --mlir-print-debuginfo -emit-fir -o - %s | FileCheck %s
|
|
|
|
subroutine sb1()
|
|
end subroutine
|
|
|
|
! CHECK: module attributes
|
|
! CHECK: func.func @_QPsb1() {
|
|
! CHECK: }
|
|
! CHECK: } loc(#[[MODULE_LOC:.*]])
|
|
! CHECK: #[[MODULE_LOC]] = loc("{{.*}}module-debug-file-loc.f90":0:0)
|