Skip to content

Commit

Permalink
[RemoveDIs] Print IR with debug records by default (llvm#91724)
Browse files Browse the repository at this point in the history
This patch makes the final major change of the RemoveDIs project, changing the
default IR output from debug intrinsics to debug records. This is expected to
break a large number of tests: every single one that tests for uses or
declarations of debug intrinsics and does not explicitly disable writing
records. 

If this patch has broken your downstream tests (or upstream tests on a
configuration I wasn't able to run):
1. If you need to immediately unblock a build, pass
`--write-experimental-debuginfo=false` to LLVM's option processing for all
failing tests (remember to use `-mllvm` for clang/flang to forward arguments to
LLVM).
2. For most test failures, the changes are trivial and mechanical, enough that
they can be done by script; see the migration guide for a guide on how to do
this: https://llvm.org/docs/RemoveDIsDebugInfo.html#test-updates
3. If any tests fail for reasons other than FileCheck check lines that need
updating, such as assertion failures, that is most likely a real bug with this
patch and should be reported as such.

For more information, see the recent PSA:
https://discourse.llvm.org/t/psa-ir-output-changing-from-debug-intrinsics-to-debug-records/79578
  • Loading branch information
SLTozer authored Jun 14, 2024
1 parent 6b4760a commit 0945727
Show file tree
Hide file tree
Showing 352 changed files with 5,416 additions and 5,289 deletions.
4 changes: 2 additions & 2 deletions clang/test/CodeGen/2010-07-08-DeclDebugLineNo.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
// Insure that dbg.declare lines for locals refer to correct line number records.
void foo(void) {
int l = 0; // line #4: CHECK: {{call.*llvm.dbg.declare.*%l.*\!dbg }}[[variable_l:![0-9]+]]
int p = 0; // line #5: CHECK: {{call.*llvm.dbg.declare.*%p.*\!dbg }}[[variable_p:![0-9]+]]
int l = 0; // line #4: CHECK: #dbg_declare({{.*%l.*}} [[variable_l:![0-9]+]]
int p = 0; // line #5: CHECK: #dbg_declare({{.*%p.*}} [[variable_p:![0-9]+]]
}
// Now match the line number records:
// CHECK: {{^}}[[variable_l]] = !DILocation(line: 4,
Expand Down
32 changes: 16 additions & 16 deletions clang/test/CodeGen/assignment-tracking/assignment-tracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,34 @@ Large L;
void zeroInit() { int Z[3] = {0, 0, 0}; }
// CHECK-LABEL: define dso_local void @_Z8zeroInitv
// CHECK: %Z = alloca [3 x i32], align 4, !DIAssignID ![[ID_0:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_0:[0-9]+]], metadata !DIExpression(), metadata ![[ID_0]], metadata ptr %Z, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_0:[0-9]+]], !DIExpression(), ![[ID_0]], ptr %Z, !DIExpression(),
// CHECK: @llvm.memset{{.*}}, !DIAssignID ![[ID_1:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i8 0, metadata ![[VAR_0]], metadata !DIExpression(), metadata ![[ID_1]], metadata ptr %Z, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i8 0, ![[VAR_0]], !DIExpression(), ![[ID_1]], ptr %Z, !DIExpression(),

void memcpyInit() { int A[4] = {0, 1, 2, 3}; }
// CHECK-LABEL: define dso_local void @_Z10memcpyInitv
// CHECK: %A = alloca [4 x i32], align 16, !DIAssignID ![[ID_2:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_1:[0-9]+]], metadata !DIExpression(), metadata ![[ID_2]], metadata ptr %A, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_1:[0-9]+]], !DIExpression(), ![[ID_2]], ptr %A, !DIExpression(),
// CHECK: @llvm.memcpy{{.*}}, !DIAssignID ![[ID_3:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_1]], metadata !DIExpression(), metadata ![[ID_3]], metadata ptr %A, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_1]], !DIExpression(), ![[ID_3]], ptr %A, !DIExpression(),

void setField() {
Outer O;
O.A.B = Value;
}
// CHECK-LABEL: define dso_local void @_Z8setFieldv
// CHECK: %O = alloca %struct.Outer, align 4, !DIAssignID ![[ID_4:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_2:[0-9]+]], metadata !DIExpression(), metadata ![[ID_4]], metadata ptr %O, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_2:[0-9]+]], !DIExpression(), ![[ID_4]], ptr %O, !DIExpression(),
// CHECK: store i32 %0, ptr %B, align 4,{{.*}}!DIAssignID ![[ID_5:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i32 %0, metadata ![[VAR_2]], metadata !DIExpression(DW_OP_LLVM_fragment, 32, 32), metadata ![[ID_5]], metadata ptr %B, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i32 %0, ![[VAR_2]], !DIExpression(DW_OP_LLVM_fragment, 32, 32), ![[ID_5]], ptr %B, !DIExpression(),

void unknownOffset() {
int A[2];
A[Index] = Value;
}
// CHECK-LABEL: define dso_local void @_Z13unknownOffsetv
// CHECK: %A = alloca [2 x i32], align 4, !DIAssignID ![[ID_6:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_3:[0-9]+]], metadata !DIExpression(), metadata ![[ID_6]], metadata ptr %A, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_3:[0-9]+]], !DIExpression(), ![[ID_6]], ptr %A, !DIExpression(),

Inner sharedAlloca() {
if (Cond) {
Expand All @@ -60,34 +60,34 @@ Inner sharedAlloca() {
}
// CHECK-LABEL: define dso_local i64 @_Z12sharedAllocav
// CHECK: %retval = alloca %struct.Inner, align 4, !DIAssignID ![[ID_7:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_4:[0-9]+]], metadata !DIExpression(), metadata ![[ID_7]], metadata ptr %retval, metadata !DIExpression())
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_5:[0-9]+]], metadata !DIExpression(), metadata ![[ID_7]], metadata ptr %retval, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_4:[0-9]+]], !DIExpression(), ![[ID_7]], ptr %retval, !DIExpression(),
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_5:[0-9]+]], !DIExpression(), ![[ID_7]], ptr %retval, !DIExpression(),
// CHECK: if.then:
// CHECK: call void @llvm.memcpy{{.*}}, !DIAssignID ![[ID_8:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_4]], metadata !DIExpression(), metadata ![[ID_8]], metadata ptr %retval, metadata !DIExpression())
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_5]], metadata !DIExpression(), metadata ![[ID_8]], metadata ptr %retval, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_4]], !DIExpression(), ![[ID_8]], ptr %retval, !DIExpression(),
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_5]], !DIExpression(), ![[ID_8]], ptr %retval, !DIExpression(),
// CHECK: if.else:
// CHECK: call void @llvm.memcpy{{.*}}, !DIAssignID ![[ID_9:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_4]], metadata !DIExpression(), metadata ![[ID_9]], metadata ptr %retval, metadata !DIExpression())
// CHECK-NEXT: call void @llvm.dbg.assign(metadata i1 undef, metadata ![[VAR_5]], metadata !DIExpression(), metadata ![[ID_9]], metadata ptr %retval, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_4]], !DIExpression(), ![[ID_9]], ptr %retval, !DIExpression(),
// CHECK-NEXT: #dbg_assign(i1 undef, ![[VAR_5]], !DIExpression(), ![[ID_9]], ptr %retval, !DIExpression(),

Large sret() {
Large X = L;
return X;
}
// CHECK-LABEL: define dso_local void @_Z4sretv
// CHECK: llvm.dbg.declare
// CHECK: #dbg_declare

void byval(Large X) {}
// CHECK-LABEL: define dso_local void @_Z5byval5Large
// CHECK: llvm.dbg.declare
// CHECK: #dbg_declare

LCopyCtor indirectReturn() {
LCopyCtor R;
return R;
}
// CHECK-LABEL: define dso_local void @_Z14indirectReturnv
// CHECK: call void @llvm.dbg.declare
// CHECK: #dbg_declare

// CHECK-DAG: ![[VAR_0]] = !DILocalVariable(name: "Z",
// CHECK-DAG: ![[VAR_1]] = !DILocalVariable(name: "A",
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGen/assignment-tracking/memcpy-fragment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void fragmentWhole()
__builtin_memcpy(&dest.ch, &src, sizeof(char));
}
// CHECK: call void @llvm.memcpy{{.+}}, !DIAssignID ![[memberID:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata{{.*}}undef, metadata !{{[0-9]+}}, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 8), metadata ![[memberID]], metadata ptr %ch, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign({{.*}}undef, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 32, 8), ![[memberID]], ptr %ch, !DIExpression(),

// Write starting at a field and overlapping part of another.
void fragmentWholeToPartial()
Expand All @@ -38,7 +38,7 @@ void fragmentWholeToPartial()
__builtin_memcpy(&dest.num1, &src, 5);
}
// CHECK: call void @llvm.memcpy{{.+}}, !DIAssignID ![[exceed:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata{{.*}}undef, metadata !{{[0-9]+}}, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 40), metadata ![[exceed]], metadata ptr %num1, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign({{.*}}undef, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 0, 40), ![[exceed]], ptr %num1, !DIExpression(),

// Write starting between fields.
void fragmentPartialToWhole()
Expand All @@ -54,4 +54,4 @@ void fragmentPartialToWhole()
__builtin_memcpy((char*)&(dest.num2) + 3, &src, 5);
}
// CHECK: call void @llvm.memcpy{{.+}}, !DIAssignID ![[addendID:[0-9]+]]
// CHECK-NEXT: call void @llvm.dbg.assign(metadata{{.*}}undef, metadata !{{.*}}, metadata !DIExpression(DW_OP_LLVM_fragment, 56, 40), metadata ![[addendID]], metadata ptr %add.ptr, metadata !DIExpression())
// CHECK-NEXT: #dbg_assign({{.*}}undef, !{{.*}}, !DIExpression(DW_OP_LLVM_fragment, 56, 40), ![[addendID]], ptr %add.ptr, !DIExpression(),
2 changes: 1 addition & 1 deletion clang/test/CodeGen/assignment-tracking/nested-scope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Check that dbg.assign intrinsics get a !dbg with with the same scope as
// their variable.

// CHECK: call void @llvm.dbg.assign({{.+}}, metadata [[local:![0-9]+]], {{.+}}, {{.+}}, {{.+}}), !dbg [[dbg:![0-9]+]]
// CHECK: #dbg_assign({{.+}}, [[local:![0-9]+]], {{.+}}, {{.+}}, {{.+}}, [[dbg:![0-9]+]]
// CHECK-DAG: [[local]] = !DILocalVariable(name: "local", scope: [[scope:![0-9]+]],
// CHECK-DAG: [[dbg]] = !DILocation({{.+}}, scope: [[scope]])
// CHECK-DAG: [[scope]] = distinct !DILexicalBlock
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/attr-nodebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void t2(void)

// Verify those things do occur normally.
// CHECK-LABEL: @t2
// CHECK: call{{.*}}llvm.dbg
// CHECK: #dbg_declare
// CHECK: !dbg
// CHECK: }

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/debug-info-block-decl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// CHECK: define{{.*}}@main()
// CHECK: store {{.*}}, !dbg ![[ASSIGNMENT:[0-9]+]]
// CHECK: define {{.*}} @__main_block_invoke
// CHECK: , !dbg ![[BLOCK_ENTRY:[0-9]+]]
// CHECK: , ![[BLOCK_ENTRY:[0-9]+]])

int main(void)
{
Expand Down
10 changes: 5 additions & 5 deletions clang/test/CodeGen/debug-info-block-expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void noEscapeFunc(__attribute__((noescape)) BlockTy);
// 'noescape') blocks.
void test_escape_func(void) {
// CHECK-LABEL: void @test_escape_func
// CHECK: call void @llvm.dbg.declare({{.*}}metadata ![[ESCAPE_VAR:[0-9]+]], metadata !DIExpression(DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}){{.*}})
// CHECK: #dbg_declare({{.*}}![[ESCAPE_VAR:[0-9]+]], !DIExpression(DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}){{.*}})
__block int escape_var;
// Blocks in dead code branches still capture __block variables.
#ifdef DEAD_CODE
Expand All @@ -22,27 +22,27 @@ void test_escape_func(void) {
// Verify that the desired DIExpression are generated for noescape blocks.
void test_noescape_func(void) {
// CHECK-LABEL: void @test_noescape_func
// CHECK: call void @llvm.dbg.declare({{.*}}metadata ![[NOESCAPE_VAR:[0-9]+]], metadata !DIExpression())
// CHECK: #dbg_declare({{.*}}![[NOESCAPE_VAR:[0-9]+]], !DIExpression(),
__block int noescape_var;
noEscapeFunc(^{ (void)noescape_var; });
}

// Verify that the desired DIExpression are generated for blocks.
void test_local_block(void) {
// CHECK-LABEL: void @test_local_block
// CHECK: call void @llvm.dbg.declare({{.*}}metadata ![[BLOCK_VAR:[0-9]+]], metadata !DIExpression(DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}){{.*}})
// CHECK: #dbg_declare({{.*}}![[BLOCK_VAR:[0-9]+]], !DIExpression(DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}){{.*}})
__block int block_var;

// CHECK-LABEL: @__test_local_block_block_invoke
// CHECK: call void @llvm.dbg.declare({{.*}}!DIExpression(DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}){{.*}})
// CHECK: #dbg_declare({{.*}}!DIExpression(DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}, DW_OP_deref, DW_OP_plus_uconst, {{[0-9]+}}){{.*}})
^ { block_var = 1; }();
}

// Verify that the desired DIExpression are generated for __block vars not used
// in any block.
void test_unused(void) {
// CHECK-LABEL: void @test_unused
// CHECK: call void @llvm.dbg.declare({{.*}}metadata ![[UNUSED_VAR:[0-9]+]], metadata !DIExpression())
// CHECK: #dbg_declare({{.*}}![[UNUSED_VAR:[0-9]+]], !DIExpression(),
__block int unused_var;
// Use i (not inside a block).
++unused_var;
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGen/debug-info-block-vars.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
// CHECK: %.block_descriptor.addr = alloca ptr, align 8
// CHECK: %block.addr = alloca ptr, align 8
// CHECK: store ptr %.block_descriptor, ptr %.block_descriptor.addr, align 8
// CHECK: call void @llvm.dbg.declare(metadata ptr %.block_descriptor.addr,
// CHECK-SAME: metadata !DIExpression())
// CHECK: #dbg_declare(ptr %.block_descriptor.addr,
// CHECK-SAME: !DIExpression(),
// CHECK-OPT-NOT: alloca
// Since the block address is not used anywhere in this function,
// the optimizer (DeadArgElim) has replaced all the false uses
// (i.e., metadata users) with poison.
// CHECK-OPT: call void @llvm.dbg.value(metadata ptr poison,
// CHECK-OPT-SAME: metadata !DIExpression())
// CHECK-OPT: #dbg_value(ptr poison,
// CHECK-OPT-SAME: !DIExpression(),
void f(void) {
a(^{
b();
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/debug-info-matrix-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
typedef double dx2x3_t __attribute__((matrix_type(2, 3)));

void load_store_double(dx2x3_t *a, dx2x3_t *b) {
// CHECK-DAG: @llvm.dbg.declare(metadata ptr %a.addr, metadata [[EXPR_A:![0-9]+]]
// CHECK-DAG: @llvm.dbg.declare(metadata ptr %b.addr, metadata [[EXPR_B:![0-9]+]]
// CHECK-DAG: #dbg_declare(ptr %a.addr, [[EXPR_A:![0-9]+]]
// CHECK-DAG: #dbg_declare(ptr %b.addr, [[EXPR_B:![0-9]+]]
// CHECK: [[PTR_TY:![0-9]+]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[TYPEDEF:![0-9]+]], size: 64)
// CHECK: [[TYPEDEF]] = !DIDerivedType(tag: DW_TAG_typedef, name: "dx2x3_t", {{.+}} baseType: [[MATRIX_TY:![0-9]+]])
// CHECK: [[MATRIX_TY]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[ELT_TY:![0-9]+]], size: 384, elements: [[ELEMENTS:![0-9]+]])
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/debug-info-vla.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

void testVLAwithSize(int s)
{
// CHECK-DAG: dbg.declare({{.*}} %__vla_expr0, metadata ![[VLAEXPR:[0-9]+]]
// CHECK-DAG: dbg.declare({{.*}} %vla, metadata ![[VAR:[0-9]+]]
// CHECK-DAG: #dbg_declare({{.*}} %__vla_expr0, ![[VLAEXPR:[0-9]+]]
// CHECK-DAG: #dbg_declare({{.*}} %vla, ![[VAR:[0-9]+]]
// CHECK-DAG: ![[VLAEXPR]] = !DILocalVariable(name: "__vla_expr0", {{.*}} flags: DIFlagArtificial
// CHECK-DAG: ![[VAR]] = !DILocalVariable(name: "vla",{{.*}} line: [[@LINE+2]]
// CHECK-DAG: !DISubrange(count: ![[VLAEXPR]])
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/debug-label-inline.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int f2(void) {
int result;

result = f1(ga, gb);
// CHECK: call void @llvm.dbg.label(metadata [[LABEL_METADATA:!.*]]), !dbg [[LABEL_LOCATION:!.*]]
// CHECK: #dbg_label([[LABEL_METADATA:!.*]], [[LABEL_LOCATION:![0-9]+]]

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/debug-label.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ int f1(int a, int b) {
int sum;

top:
// CHECK: call void @llvm.dbg.label(metadata [[LABEL_METADATA:!.*]]), !dbg [[LABEL_LOCATION:!.*]]
// CHECK: #dbg_label([[LABEL_METADATA:!.*]], [[LABEL_LOCATION:![0-9]+]]
sum = a + b;
return sum;
}
Expand Down
1 change: 0 additions & 1 deletion clang/test/CodeGen/instrument-objc-method.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ + (void)load __attribute__((no_instrument_function)) {
- (void)dealloc __attribute__((no_instrument_function)) {
}

// PREINLINE: declare void @llvm.dbg.declare(metadata, metadata, metadata) #2
// PREINLINE: attributes #0 = { {{.*}}"instrument-function-entry"="__cyg_profile_func_enter"
// PREINLINE-NOT: attributes #0 = { {{.*}}"instrument-function-entry"="__cyg_profile_func_enter_bare"
// PREINLINE-NOT: attributes #2 = { {{.*}}"__cyg_profile_func_enter"
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGenCUDA/debug-info-address-class.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ __device__ __constant__ int FileVar2;

__device__ void kernel1(
// CHECK-DAG: ![[ARG:[0-9]+]] = !DILocalVariable(name: "Arg", arg: {{[0-9]+}}, scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, type: !{{[0-9]+}})
// CHECK-DAG: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[ARG]], metadata !DIExpression()), !dbg !{{[0-9]+}}
// CHECK-DAG: #dbg_declare(ptr {{.*}}, ![[ARG]], !DIExpression(), !{{[0-9]+}}
int Arg) {
// CHECK-DAG: ![[FUNCVAR0:[0-9]+]] = distinct !DIGlobalVariable(name: "FuncVar0", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, type: !{{[0-9]+}}, isLocal: true, isDefinition: true)
// CHECK-DAG: !DIGlobalVariableExpression(var: ![[FUNCVAR0]], expr: !DIExpression(DW_OP_constu, 8, DW_OP_swap, DW_OP_xderef))
__shared__ int FuncVar0;
// CHECK-DAG: ![[FUNCVAR1:[0-9]+]] = !DILocalVariable(name: "FuncVar1", scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: {{[0-9]+}}, type: !{{[0-9]+}})
// CHECK-DAG: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[FUNCVAR1]], metadata !DIExpression()), !dbg !{{[0-9]+}}
// CHECK-DAG: #dbg_declare(ptr {{.*}}, ![[FUNCVAR1]], !DIExpression(), !{{[0-9]+}}
int FuncVar1;
}
6 changes: 3 additions & 3 deletions clang/test/CodeGenCXX/debug-info-inheriting-constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ struct B : A {
A::A(int i, ...) {}
// CHECK: define{{.*}} void @{{.*}}foo
// CHECK-NOT: ret void
// CHECK: call void @llvm.dbg.declare
// CHECK: #dbg_declare
// CHECK-NOT: ret void
// CHECK: call void @llvm.dbg.declare(metadata ptr %{{[^,]+}},
// CHECK-SAME: metadata ![[THIS:[0-9]+]], metadata !DIExpression()), !dbg ![[LOC:[0-9]+]]
// CHECK: #dbg_declare(ptr %{{[^,]+}},
// CHECK-SAME: ![[THIS:[0-9]+]], !DIExpression(), ![[LOC:[0-9]+]]
// CHECK: ret void, !dbg ![[NOINL:[0-9]+]]
// CHECK: ![[FOO:.*]] = distinct !DISubprogram(name: "foo"
// CHECK-DAG: ![[A:.*]] = distinct !DISubprogram(name: "A", linkageName: "_ZN1BCI11AEiz"
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGenCXX/debug-info-nrvo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ int main() {
// stored in the return register.

// CHECK: %[[RESULT:.*]] = alloca ptr, align 8
// CHECK: call void @llvm.dbg.declare(metadata ptr %[[RESULT]],
// CHECK-SAME: metadata !DIExpression(DW_OP_deref)
// CHECK: #dbg_declare(ptr %[[RESULT]],
// CHECK-SAME: !DIExpression(DW_OP_deref)

// NOELIDE: %[[FOO:.*]] = alloca %struct.Foo, align 4
// NOELIDE: call void @llvm.dbg.declare(metadata ptr %[[FOO]],
// NOELIDE-SAME: metadata !DIExpression()
// NOELIDE: #dbg_declare(ptr %[[FOO]],
// NOELIDE-SAME: !DIExpression()
18 changes: 9 additions & 9 deletions clang/test/CodeGenCXX/debug-info-range-for-var-names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ void test() {
}
}

// CHECK: call void @llvm.dbg.declare(metadata ptr %__range1, metadata ![[RANGE1:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[BEGIN1:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[END1:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata ptr %__range2, metadata ![[RANGE2:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[BEGIN2:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[END2:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata ptr %__range3, metadata ![[RANGE3:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[BEGIN3:[0-9]+]]
// CHECK: call void @llvm.dbg.declare(metadata ptr {{.*}}, metadata ![[END3:[0-9]+]]
// CHECK: #dbg_declare(ptr %__range1, ![[RANGE1:[0-9]+]]
// CHECK: #dbg_declare(ptr {{[^,]*}}, ![[BEGIN1:[0-9]+]]
// CHECK: #dbg_declare(ptr {{[^,]*}}, ![[END1:[0-9]+]]
// CHECK: #dbg_declare(ptr %__range2, ![[RANGE2:[0-9]+]]
// CHECK: #dbg_declare(ptr {{[^,]*}}, ![[BEGIN2:[0-9]+]]
// CHECK: #dbg_declare(ptr {{[^,]*}}, ![[END2:[0-9]+]]
// CHECK: #dbg_declare(ptr %__range3, ![[RANGE3:[0-9]+]]
// CHECK: #dbg_declare(ptr {{[^,]*}}, ![[BEGIN3:[0-9]+]]
// CHECK: #dbg_declare(ptr {{[^,]*}}, ![[END3:[0-9]+]]
// CHECK: ![[RANGE1]] = !DILocalVariable(name: "__range1",
// CHECK: ![[BEGIN1]] = !DILocalVariable(name: "__begin1",
// CHECK: ![[END1]] = !DILocalVariable(name: "__end1",
Expand Down
Loading

0 comments on commit 0945727

Please sign in to comment.