This PR generates dwarf to extract the information about the arrays from
descriptor. The DWARF needs the offset of the fields like `lower_bound`
and `extent`. The getComponentOffset has been added to calculate
them which pushes the issue of host and target data size into
getDescFieldTypeModel.
As we use data layout now, some tests needed to be adjusted to have a
dummy data layout to avoid failure.
With this change in place, GDB is able show the assumed shape arrays
correctly.
subroutine ff(n, m, arr)
integer n, m
integer :: arr(:, :)
print *, arr
do i = 1, n
do j = 1, m
arr(j, i) = (i * 5) + j + 10
end do
end do
print *, arr
end subroutine ff
Breakpoint 1, ff (n=4, m=3, arr=...) at test1.f90:13
13 print *, arr
(gdb) p arr
$1 = ((6, 7, 8, 9) (11, 12, 13, 14) (16, 17, 18, 19))
(gdb) ptype arr
type = integer (4,3)
(gdb) c
Continuing.
6 7 8 9 11 12 13 14 16 17 18 19
24 lines
1.6 KiB
Plaintext
24 lines
1.6 KiB
Plaintext
|
|
// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s
|
|
// REQUIRES: system-linux
|
|
|
|
// Test that there are no changes to a function with existed fused loc debug
|
|
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
|
|
func.func @_QPs1() {
|
|
return loc(#loc1)
|
|
} loc(#loc2)
|
|
} loc(#loc)
|
|
#di_basic_type = #llvm.di_basic_type<tag = DW_TAG_base_type, name = "void", encoding = DW_ATE_address>
|
|
#di_file = #llvm.di_file<"simple.f90" in "/home/user01/llvm-project/build_release">
|
|
#loc = loc("/home/user01/llvm-project/build_release/simple.f90":0:0)
|
|
#loc1 = loc("/home/user01/llvm-project/build_release/simple.f90":1:1)
|
|
#di_compile_unit = #llvm.di_compile_unit<id = distinct[0]<>, sourceLanguage = DW_LANG_Fortran95, file = #di_file, producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly>
|
|
#di_subroutine_type = #llvm.di_subroutine_type<callingConvention = DW_CC_normal, types = #di_basic_type, #di_basic_type>
|
|
#di_subprogram = #llvm.di_subprogram<compileUnit = #di_compile_unit, scope = #di_file, name = "_QPs1", linkageName = "_QPs1", file = #di_file, line = 1, scopeLine = 1, subprogramFlags = Definition, type = #di_subroutine_type>
|
|
#loc2 = loc(fused<#di_subprogram>[#loc1])
|
|
|
|
// CHECK: #loc = loc("/home/user01/llvm-project/build_release/simple.f90":0:0)
|
|
// CHECK: #loc1 = loc("/home/user01/llvm-project/build_release/simple.f90":1:1)
|
|
// CHECK: #di_subprogram = #llvm.di_subprogram<compileUnit = #di_compile_unit, scope = #di_file, name = "_QPs1", linkageName = "_QPs1", file = #di_file, line = 1, scopeLine = 1, subprogramFlags = Definition, type = #di_subroutine_type>
|
|
// CHECK: #loc2 = loc(fused<#di_subprogram>[#loc1])
|