Skip to content

Commit b64cf38

Browse files
authored
[flang][debug] Support assumed shape arrays. (#94644)
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
1 parent 4cff320 commit b64cf38

14 files changed

+182
-23
lines changed

flang/lib/Optimizer/CodeGen/DescriptorModel.h renamed to flang/include/flang/Optimizer/CodeGen/DescriptorModel.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,73 +35,73 @@ using TypeBuilderFunc = mlir::Type (*)(mlir::MLIRContext *);
3535

3636
/// Get the LLVM IR dialect model for building a particular C++ type, `T`.
3737
template <typename T>
38-
TypeBuilderFunc getModel();
38+
static TypeBuilderFunc getModel();
3939

4040
template <>
41-
TypeBuilderFunc getModel<void *>() {
41+
constexpr TypeBuilderFunc getModel<void *>() {
4242
return [](mlir::MLIRContext *context) -> mlir::Type {
4343
return mlir::LLVM::LLVMPointerType::get(context);
4444
};
4545
}
4646
template <>
47-
TypeBuilderFunc getModel<unsigned>() {
47+
constexpr TypeBuilderFunc getModel<unsigned>() {
4848
return [](mlir::MLIRContext *context) -> mlir::Type {
4949
return mlir::IntegerType::get(context, sizeof(unsigned) * 8);
5050
};
5151
}
5252
template <>
53-
TypeBuilderFunc getModel<int>() {
53+
constexpr TypeBuilderFunc getModel<int>() {
5454
return [](mlir::MLIRContext *context) -> mlir::Type {
5555
return mlir::IntegerType::get(context, sizeof(int) * 8);
5656
};
5757
}
5858
template <>
59-
TypeBuilderFunc getModel<unsigned long>() {
59+
constexpr TypeBuilderFunc getModel<unsigned long>() {
6060
return [](mlir::MLIRContext *context) -> mlir::Type {
6161
return mlir::IntegerType::get(context, sizeof(unsigned long) * 8);
6262
};
6363
}
6464
template <>
65-
TypeBuilderFunc getModel<unsigned long long>() {
65+
constexpr TypeBuilderFunc getModel<unsigned long long>() {
6666
return [](mlir::MLIRContext *context) -> mlir::Type {
6767
return mlir::IntegerType::get(context, sizeof(unsigned long long) * 8);
6868
};
6969
}
7070
template <>
71-
TypeBuilderFunc getModel<long long>() {
71+
constexpr TypeBuilderFunc getModel<long long>() {
7272
return [](mlir::MLIRContext *context) -> mlir::Type {
7373
return mlir::IntegerType::get(context, sizeof(long long) * 8);
7474
};
7575
}
7676
template <>
77-
TypeBuilderFunc getModel<Fortran::ISO::CFI_rank_t>() {
77+
constexpr TypeBuilderFunc getModel<Fortran::ISO::CFI_rank_t>() {
7878
return [](mlir::MLIRContext *context) -> mlir::Type {
7979
return mlir::IntegerType::get(context,
8080
sizeof(Fortran::ISO::CFI_rank_t) * 8);
8181
};
8282
}
8383
template <>
84-
TypeBuilderFunc getModel<Fortran::ISO::CFI_type_t>() {
84+
constexpr TypeBuilderFunc getModel<Fortran::ISO::CFI_type_t>() {
8585
return [](mlir::MLIRContext *context) -> mlir::Type {
8686
return mlir::IntegerType::get(context,
8787
sizeof(Fortran::ISO::CFI_type_t) * 8);
8888
};
8989
}
9090
template <>
91-
TypeBuilderFunc getModel<long>() {
91+
constexpr TypeBuilderFunc getModel<long>() {
9292
return [](mlir::MLIRContext *context) -> mlir::Type {
9393
return mlir::IntegerType::get(context, sizeof(long) * 8);
9494
};
9595
}
9696
template <>
97-
TypeBuilderFunc getModel<Fortran::ISO::CFI_dim_t>() {
97+
constexpr TypeBuilderFunc getModel<Fortran::ISO::CFI_dim_t>() {
9898
return [](mlir::MLIRContext *context) -> mlir::Type {
9999
auto indexTy = getModel<Fortran::ISO::CFI_index_t>()(context);
100100
return mlir::LLVM::LLVMArrayType::get(indexTy, 3);
101101
};
102102
}
103103
template <>
104-
TypeBuilderFunc
104+
constexpr TypeBuilderFunc
105105
getModel<Fortran::ISO::cfi_internal::FlexibleArray<Fortran::ISO::CFI_dim_t>>() {
106106
return getModel<Fortran::ISO::CFI_dim_t>();
107107
}

flang/lib/Optimizer/CodeGen/TypeConverter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#define DEBUG_TYPE "flang-type-conversion"
1414

1515
#include "flang/Optimizer/CodeGen/TypeConverter.h"
16-
#include "DescriptorModel.h"
1716
#include "flang/Common/Fortran.h"
1817
#include "flang/Optimizer/Builder/Todo.h" // remove when TODO's are done
18+
#include "flang/Optimizer/CodeGen/DescriptorModel.h"
1919
#include "flang/Optimizer/CodeGen/TBAABuilder.h"
2020
#include "flang/Optimizer/CodeGen/Target.h"
2121
#include "flang/Optimizer/Dialect/FIRType.h"

flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,55 @@
1313
#define DEBUG_TYPE "flang-debug-type-generator"
1414

1515
#include "DebugTypeGenerator.h"
16+
#include "flang/Optimizer/CodeGen/DescriptorModel.h"
17+
#include "flang/Optimizer/CodeGen/TypeConverter.h"
18+
#include "flang/Optimizer/Support/DataLayout.h"
19+
#include "mlir/Pass/Pass.h"
1620
#include "llvm/ADT/ScopeExit.h"
1721
#include "llvm/BinaryFormat/Dwarf.h"
1822
#include "llvm/Support/Debug.h"
1923

2024
namespace fir {
2125

26+
/// Calculate offset of any field in the descriptor.
27+
template <int DescriptorField>
28+
std::uint64_t getComponentOffset(const mlir::DataLayout &dl,
29+
mlir::MLIRContext *context,
30+
mlir::Type llvmFieldType) {
31+
static_assert(DescriptorField > 0 && DescriptorField < 10);
32+
mlir::Type previousFieldType =
33+
getDescFieldTypeModel<DescriptorField - 1>()(context);
34+
std::uint64_t previousOffset =
35+
getComponentOffset<DescriptorField - 1>(dl, context, previousFieldType);
36+
std::uint64_t offset = previousOffset + dl.getTypeSize(previousFieldType);
37+
std::uint64_t fieldAlignment = dl.getTypeABIAlignment(llvmFieldType);
38+
return llvm::alignTo(offset, fieldAlignment);
39+
}
40+
template <>
41+
std::uint64_t getComponentOffset<0>(const mlir::DataLayout &dl,
42+
mlir::MLIRContext *context,
43+
mlir::Type llvmFieldType) {
44+
return 0;
45+
}
46+
2247
DebugTypeGenerator::DebugTypeGenerator(mlir::ModuleOp m)
2348
: module(m), kindMapping(getKindMapping(m)) {
2449
LLVM_DEBUG(llvm::dbgs() << "DITypeAttr generator\n");
50+
51+
std::optional<mlir::DataLayout> dl =
52+
fir::support::getOrSetDataLayout(module, /*allowDefaultLayout=*/true);
53+
if (!dl) {
54+
mlir::emitError(module.getLoc(), "Missing data layout attribute in module");
55+
return;
56+
}
57+
58+
mlir::MLIRContext *context = module.getContext();
59+
60+
// The debug information requires the offset of certain fields in the
61+
// descriptors like lower_bound and extent for each dimension.
62+
mlir::Type llvmDimsType = getDescFieldTypeModel<kDimsPosInBox>()(context);
63+
dimsOffset = getComponentOffset<kDimsPosInBox>(*dl, context, llvmDimsType);
64+
dimsSize = dl->getTypeSize(llvmDimsType);
2565
}
2666

2767
static mlir::LLVM::DITypeAttr genBasicType(mlir::MLIRContext *context,
@@ -37,10 +77,82 @@ static mlir::LLVM::DITypeAttr genPlaceholderType(mlir::MLIRContext *context) {
3777
llvm::dwarf::DW_ATE_signed);
3878
}
3979

80+
mlir::LLVM::DITypeAttr DebugTypeGenerator::convertBoxedSequenceType(
81+
fir::SequenceType seqTy, mlir::LLVM::DIFileAttr fileAttr,
82+
mlir::LLVM::DIScopeAttr scope, mlir::Location loc, bool genAllocated,
83+
bool genAssociated) {
84+
85+
mlir::MLIRContext *context = module.getContext();
86+
// FIXME: Assumed rank arrays not supported yet
87+
if (seqTy.hasUnknownShape())
88+
return genPlaceholderType(context);
89+
90+
llvm::SmallVector<mlir::LLVM::DIExpressionElemAttr> ops;
91+
auto addOp = [&](unsigned opc, llvm::ArrayRef<uint64_t> vals) {
92+
ops.push_back(mlir::LLVM::DIExpressionElemAttr::get(context, opc, vals));
93+
};
94+
95+
addOp(llvm::dwarf::DW_OP_push_object_address, {});
96+
addOp(llvm::dwarf::DW_OP_deref, {});
97+
98+
// dataLocation = *base_addr
99+
mlir::LLVM::DIExpressionAttr dataLocation =
100+
mlir::LLVM::DIExpressionAttr::get(context, ops);
101+
addOp(llvm::dwarf::DW_OP_lit0, {});
102+
addOp(llvm::dwarf::DW_OP_ne, {});
103+
104+
// allocated = associated = (*base_addr != 0)
105+
mlir::LLVM::DIExpressionAttr valid =
106+
mlir::LLVM::DIExpressionAttr::get(context, ops);
107+
mlir::LLVM::DIExpressionAttr associated = genAllocated ? valid : nullptr;
108+
mlir::LLVM::DIExpressionAttr allocated = genAssociated ? valid : nullptr;
109+
ops.clear();
110+
111+
llvm::SmallVector<mlir::LLVM::DINodeAttr> elements;
112+
mlir::LLVM::DITypeAttr elemTy =
113+
convertType(seqTy.getEleTy(), fileAttr, scope, loc);
114+
unsigned offset = dimsOffset;
115+
const unsigned indexSize = dimsSize / 3;
116+
for ([[maybe_unused]] auto _ : seqTy.getShape()) {
117+
// For each dimension, find the offset of count and lower bound in the
118+
// descriptor and generate the dwarf expression to extract it.
119+
// FIXME: If `indexSize` happens to be bigger than address size on the
120+
// system then we may have to change 'DW_OP_deref' here.
121+
addOp(llvm::dwarf::DW_OP_push_object_address, {});
122+
addOp(llvm::dwarf::DW_OP_plus_uconst,
123+
{offset + (indexSize * kDimExtentPos)});
124+
addOp(llvm::dwarf::DW_OP_deref, {});
125+
// count[i] = *(base_addr + offset + (indexSize * kDimExtentPos))
126+
// where 'offset' is dimsOffset + (i * dimsSize)
127+
mlir::LLVM::DIExpressionAttr countAttr =
128+
mlir::LLVM::DIExpressionAttr::get(context, ops);
129+
ops.clear();
130+
131+
addOp(llvm::dwarf::DW_OP_push_object_address, {});
132+
addOp(llvm::dwarf::DW_OP_plus_uconst,
133+
{offset + (indexSize * kDimLowerBoundPos)});
134+
addOp(llvm::dwarf::DW_OP_deref, {});
135+
// lower_bound[i] = *(base_addr + offset + (indexSize * kDimLowerBoundPos))
136+
mlir::LLVM::DIExpressionAttr lowerAttr =
137+
mlir::LLVM::DIExpressionAttr::get(context, ops);
138+
ops.clear();
139+
140+
offset += dimsSize;
141+
mlir::LLVM::DISubrangeAttr subrangeTy = mlir::LLVM::DISubrangeAttr::get(
142+
context, nullptr, lowerAttr, countAttr, nullptr);
143+
elements.push_back(subrangeTy);
144+
}
145+
return mlir::LLVM::DICompositeTypeAttr::get(
146+
context, llvm::dwarf::DW_TAG_array_type, /*recursive id*/ {},
147+
/* name */ nullptr, /* file */ nullptr, /* line */ 0,
148+
/* scope */ nullptr, elemTy, mlir::LLVM::DIFlags::Zero,
149+
/* sizeInBits */ 0, /*alignInBits*/ 0, elements, dataLocation,
150+
/* rank */ nullptr, allocated, associated);
151+
}
152+
40153
mlir::LLVM::DITypeAttr DebugTypeGenerator::convertSequenceType(
41154
fir::SequenceType seqTy, mlir::LLVM::DIFileAttr fileAttr,
42155
mlir::LLVM::DIScopeAttr scope, mlir::Location loc) {
43-
44156
mlir::MLIRContext *context = module.getContext();
45157
// FIXME: Only fixed sizes arrays handled at the moment.
46158
if (seqTy.hasDynamicExtents())
@@ -112,6 +224,12 @@ DebugTypeGenerator::convertType(mlir::Type Ty, mlir::LLVM::DIFileAttr fileAttr,
112224
bitWidth * 2, llvm::dwarf::DW_ATE_complex_float);
113225
} else if (auto seqTy = mlir::dyn_cast_or_null<fir::SequenceType>(Ty)) {
114226
return convertSequenceType(seqTy, fileAttr, scope, loc);
227+
} else if (auto boxTy = mlir::dyn_cast_or_null<fir::BoxType>(Ty)) {
228+
auto elTy = boxTy.getElementType();
229+
if (auto seqTy = mlir::dyn_cast_or_null<fir::SequenceType>(elTy))
230+
return convertBoxedSequenceType(seqTy, fileAttr, scope, loc, false,
231+
false);
232+
return genPlaceholderType(context);
115233
} else {
116234
// FIXME: These types are currently unhandled. We are generating a
117235
// placeholder type to allow us to test supported bits.

flang/lib/Optimizer/Transforms/DebugTypeGenerator.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,20 @@ class DebugTypeGenerator {
3535
mlir::LLVM::DIFileAttr fileAttr,
3636
mlir::LLVM::DIScopeAttr scope,
3737
mlir::Location loc);
38+
39+
/// The 'genAllocated' is true when we want to generate 'allocated' field
40+
/// in the DICompositeType. It is needed for the allocatable arrays.
41+
/// Similarly, 'genAssociated' is used with 'pointer' type to generate
42+
/// 'associated' field.
43+
mlir::LLVM::DITypeAttr
44+
convertBoxedSequenceType(fir::SequenceType seqTy,
45+
mlir::LLVM::DIFileAttr fileAttr,
46+
mlir::LLVM::DIScopeAttr scope, mlir::Location loc,
47+
bool genAllocated, bool genAssociated);
3848
mlir::ModuleOp module;
3949
KindMapping kindMapping;
50+
std::uint64_t dimsSize;
51+
std::uint64_t dimsOffset;
4052
};
4153

4254
} // namespace fir
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
2+
3+
subroutine ff(arr)
4+
implicit none
5+
integer :: arr(:, :)
6+
return arr(1,1)
7+
end subroutine ff
8+
9+
! CHECK-DAG: !DICompositeType(tag: DW_TAG_array_type{{.*}}elements: ![[ELEMS:[0-9]+]], dataLocation: !DIExpression(DW_OP_push_object_address, DW_OP_deref))
10+
! CHECK-DAG: ![[ELEMS]] = !{![[ELEM1:[0-9]+]], ![[ELEM2:[0-9]+]]}
11+
! CHECK-DAG: ![[ELEM1]] = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 24, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 32, DW_OP_deref))
12+
! CHECK-DAG: ![[ELEM2]] = !DISubrange(lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 48, DW_OP_deref), upperBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 56, DW_OP_deref))
13+

flang/test/Transforms/debug-90683.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// This test checks that debug information for fir.real type works ok.
44

5-
module attributes {} {
5+
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
66
func.func @_QPfn1(%arg0: !fir.ref<!fir.complex<8>> {fir.bindc_name = "a"} ) {
77
%0 = fir.declare %arg0 {uniq_name = "_QFfn1Ea"} : (!fir.ref<!fir.complex<8>>) -> !fir.ref<!fir.complex<8>>
88
%1 = fir.alloca f32 {bindc_name = "abserror", uniq_name = "_QFfn1Eabserror"}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s
2+
3+
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<i64, dense<64> : vector<2xi64>>, #dlti.dl_entry<!llvm.ptr<272>, dense<64> : vector<4xi64>>, #dlti.dl_entry<!llvm.ptr<271>, dense<32> : vector<4xi64>>, #dlti.dl_entry<!llvm.ptr<270>, dense<32> : vector<4xi64>>, #dlti.dl_entry<f128, dense<128> : vector<2xi64>>, #dlti.dl_entry<f80, dense<128> : vector<2xi64>>, #dlti.dl_entry<i128, dense<128> : vector<2xi64>>, #dlti.dl_entry<i8, dense<8> : vector<2xi64>>, #dlti.dl_entry<!llvm.ptr, dense<64> : vector<4xi64>>, #dlti.dl_entry<i1, dense<8> : vector<2xi64>>, #dlti.dl_entry<f16, dense<16> : vector<2xi64>>, #dlti.dl_entry<f64, dense<64> : vector<2xi64>>, #dlti.dl_entry<i32, dense<32> : vector<2xi64>>, #dlti.dl_entry<i16, dense<16> : vector<2xi64>>, #dlti.dl_entry<"dlti.stack_alignment", 128 : i64>, #dlti.dl_entry<"dlti.endianness", "little">>, fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"} {
4+
func.func @ff_(%arg0: !fir.box<!fir.array<?x?xi32>> {fir.bindc_name = "arr"} ) {
5+
%0 = fir.undefined !fir.dscope
6+
%1 = fircg.ext_declare %arg0 dummy_scope %0 {uniq_name = "_QFffEarr"} : (!fir.box<!fir.array<?x?xi32>>, !fir.dscope) -> !fir.box<!fir.array<?x?xi32>> loc(#loc1)
7+
return
8+
} loc(#loc2)
9+
}
10+
#loc1 = loc("test1.f90":1:1)
11+
#loc2 = loc("test1.f90":3:16)
12+
13+
// CHECK: #llvm.di_composite_type<tag = DW_TAG_array_type
14+
// CHECK-SAME: elements = #llvm.di_subrange<lowerBound = #llvm.di_expression<[DW_OP_push_object_address, DW_OP_plus_uconst(24), DW_OP_deref]>, upperBound = #llvm.di_expression<[DW_OP_push_object_address, DW_OP_plus_uconst(32), DW_OP_deref]>>
15+
// CHECK-SAME: #llvm.di_subrange<lowerBound = #llvm.di_expression<[DW_OP_push_object_address, DW_OP_plus_uconst(48), DW_OP_deref]>, upperBound = #llvm.di_expression<[DW_OP_push_object_address, DW_OP_plus_uconst(56), DW_OP_deref]>>
16+
// CHECK-SAME: dataLocation = <[DW_OP_push_object_address, DW_OP_deref]>>

flang/test/Transforms/debug-complex-1.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// check conversion of complex type of different size. Both fir and mlir
44
// variants are checked.
55

6-
module attributes {fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.target_triple = "native"} {
6+
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
77
func.func @test1(%x : !fir.complex<4>) -> !fir.complex<8> {
88
%1 = fir.convert %x : (!fir.complex<4>) -> !fir.complex<8>
99
return %1 : !fir.complex<8>

flang/test/Transforms/debug-fixed-array-type.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s
22

3-
module attributes {} {
3+
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
44
func.func @_QQmain() attributes {fir.bindc_name = "mn"} {
55
%c7 = arith.constant 7 : index
66
%c8 = arith.constant 8 : index

flang/test/Transforms/debug-line-table-existing.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// REQUIRES: system-linux
44

55
// Test that there are no changes to a function with existed fused loc debug
6-
module attributes {} {
6+
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
77
func.func @_QPs1() {
88
return loc(#loc1)
99
} loc(#loc2)

flang/test/Transforms/debug-line-table-inc-file.fir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// REQUIRES: system-linux
44

55
// Test for included functions that have a different debug location than the current file
6-
module attributes {} {
6+
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
77
func.func @_QPsinc() {
88
return loc(#loc2)
99
} loc(#loc1)
@@ -19,7 +19,7 @@ module attributes {} {
1919
#loc4 = loc("/home/user01/llvm-project/build_release/simple.f90":4:3)
2020
#loc5 = loc("/home/user01/llvm-project/build_release/simple.f90":5:1)
2121
22-
// CHECK: module {
22+
// CHECK: module
2323
// CHECK: func.func @_QPsinc() {
2424
// CHECK: } loc(#[[FUSED_LOC_INC_FILE:.*]])
2525
// CHECK: func.func @_QQmain() {

flang/test/Transforms/debug-line-table-inc-same-file.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Test that there is only one FileAttribute generated for multiple functions
66
// in the same file.
7-
module attributes {} {
7+
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
88
func.func @_QPs1() {
99
return loc(#loc2)
1010
} loc(#loc1)

flang/test/Transforms/debug-line-table.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: fir-opt --add-debug-info="debug-level=LineTablesOnly" --mlir-print-debuginfo %s | FileCheck %s --check-prefix=LINETABLE
44
// RUN: fir-opt --add-debug-info="is-optimized=true" --mlir-print-debuginfo %s | FileCheck %s --check-prefix=OPT
55

6-
module attributes { fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.data_layout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128", llvm.target_triple = "aarch64-unknown-linux-gnu"} {
6+
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
77
func.func @_QPsb() {
88
return loc(#loc_sb)
99
} loc(#loc_sb)

flang/test/Transforms/debug-module-1.fir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s
22

33

4-
module attributes {} {
4+
module attributes {dlti.dl_spec = #dlti.dl_spec<>} {
55
fir.global @_QMhelperEgli : i32 {
66
%0 = fir.zero_bits i32
77
fir.has_value %0 : i32

0 commit comments

Comments
 (0)