diff --git a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp index c2d58a8efc5062..db559731552df2 100644 --- a/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp +++ b/flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp @@ -143,7 +143,8 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertBoxedSequenceType( offset += dimsSize; mlir::LLVM::DISubrangeAttr subrangeTy = mlir::LLVM::DISubrangeAttr::get( - context, nullptr, lowerAttr, countAttr, nullptr); + context, countAttr, lowerAttr, /*upperBound=*/nullptr, + /*stride=*/nullptr); elements.push_back(subrangeTy); } return mlir::LLVM::DICompositeTypeAttr::get( @@ -183,7 +184,8 @@ mlir::LLVM::DITypeAttr DebugTypeGenerator::convertSequenceType( auto countAttr = mlir::IntegerAttr::get(intTy, llvm::APInt(64, dim)); auto lowerAttr = mlir::IntegerAttr::get(intTy, llvm::APInt(64, 1)); auto subrangeTy = mlir::LLVM::DISubrangeAttr::get( - context, countAttr, lowerAttr, nullptr, nullptr); + context, countAttr, lowerAttr, /*upperBound=*/nullptr, + /*stride=*/nullptr); elements.push_back(subrangeTy); } } diff --git a/flang/test/Integration/debug-assumed-shape-array.f90 b/flang/test/Integration/debug-assumed-shape-array.f90 index 7b0801c12dba11..a23ffa13cf0ac6 100644 --- a/flang/test/Integration/debug-assumed-shape-array.f90 +++ b/flang/test/Integration/debug-assumed-shape-array.f90 @@ -8,6 +8,6 @@ end subroutine ff ! CHECK-DAG: !DICompositeType(tag: DW_TAG_array_type{{.*}}elements: ![[ELEMS:[0-9]+]], dataLocation: !DIExpression(DW_OP_push_object_address, DW_OP_deref)) ! CHECK-DAG: ![[ELEMS]] = !{![[ELEM1:[0-9]+]], ![[ELEM2:[0-9]+]]} -! 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)) -! 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)) +! CHECK-DAG: ![[ELEM1]] = !DISubrange(count: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 32, DW_OP_deref), lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 24, DW_OP_deref)) +! CHECK-DAG: ![[ELEM2]] = !DISubrange(count: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 56, DW_OP_deref), lowerBound: !DIExpression(DW_OP_push_object_address, DW_OP_plus_uconst, 48, DW_OP_deref)) diff --git a/flang/test/Transforms/debug-assumed-shape-array.fir b/flang/test/Transforms/debug-assumed-shape-array.fir index 00dec9b318c811..0a9b84ad253aab 100644 --- a/flang/test/Transforms/debug-assumed-shape-array.fir +++ b/flang/test/Transforms/debug-assumed-shape-array.fir @@ -11,6 +11,6 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry : #loc2 = loc("test1.f90":3:16) // CHECK: #llvm.di_composite_type, upperBound = #llvm.di_expression<[DW_OP_push_object_address, DW_OP_plus_uconst(32), DW_OP_deref]>> -// CHECK-SAME: #llvm.di_subrange, upperBound = #llvm.di_expression<[DW_OP_push_object_address, DW_OP_plus_uconst(56), DW_OP_deref]>> +// CHECK-SAME: elements = #llvm.di_subrange, lowerBound = #llvm.di_expression<[DW_OP_push_object_address, DW_OP_plus_uconst(24), DW_OP_deref]>>, +// CHECK-SAME: #llvm.di_subrange, lowerBound = #llvm.di_expression<[DW_OP_push_object_address, DW_OP_plus_uconst(48), DW_OP_deref]>> // CHECK-SAME: dataLocation = <[DW_OP_push_object_address, DW_OP_deref]>> diff --git a/flang/test/Transforms/debug-ptr-type.fir b/flang/test/Transforms/debug-ptr-type.fir index 3f6c895ddaf8eb..64e64cb1a19aee 100644 --- a/flang/test/Transforms/debug-ptr-type.fir +++ b/flang/test/Transforms/debug-ptr-type.fir @@ -32,8 +32,8 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<>} { #loc4 = loc("test.f90":8:1) // CHECK-DAG: #[[INT_TY:.*]] = #llvm.di_basic_type -// CHECK-DAG: #[[ARR1_TY:.*]] = #llvm.di_composite_type, #llvm.di_subrange, dataLocation = {{.*}}, associated = <[DW_OP_push_object_address, DW_OP_deref, DW_OP_lit0, DW_OP_ne]>> -// CHECK-DAG: #[[ARR2_TY:.*]] = #llvm.di_composite_type, dataLocation = {{.*}}, associated = <[DW_OP_push_object_address, DW_OP_deref, DW_OP_lit0, DW_OP_ne]>> +// CHECK-DAG: #[[ARR1_TY:.*]] = #llvm.di_composite_type, lowerBound = #llvm.di_expression<{{.*}}>, #llvm.di_subrange, lowerBound = #llvm.di_expression<{{.*}}>>, dataLocation = {{.*}}, associated = <[DW_OP_push_object_address, DW_OP_deref, DW_OP_lit0, DW_OP_ne]>> +// CHECK-DAG: #[[ARR2_TY:.*]] = #llvm.di_composite_type, lowerBound = #llvm.di_expression<{{.*}}>>, dataLocation = {{.*}}, associated = <[DW_OP_push_object_address, DW_OP_deref, DW_OP_lit0, DW_OP_ne]>> // CHECK-DAG: #[[PTR_TY:.*]] = #llvm.di_derived_type // CHECK-DAG: #llvm.di_global_variable<{{.*}}name = "par"{{.*}}type = #[[ARR1_TY]]{{.*}}> // CHECK-DAG: #llvm.di_global_variable<{{.*}}name = "par2"{{.*}}type = #[[ARR2_TY]]{{.*}}>