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
36 lines
890 B
C++
36 lines
890 B
C++
// RUN: %clangxx -target x86_64-unknown-unknown -g \
|
|
// RUN: %s -emit-llvm -S -o - | FileCheck %s
|
|
|
|
// RUN: %clangxx -target x86_64-unknown-unknown -g \
|
|
// RUN: -fno-elide-constructors %s -emit-llvm -S -o - | \
|
|
// RUN: FileCheck %s -check-prefix=NOELIDE
|
|
|
|
struct Foo {
|
|
Foo() = default;
|
|
Foo(Foo &&other) { x = other.x; }
|
|
int x;
|
|
};
|
|
void some_function(int);
|
|
Foo getFoo() {
|
|
Foo foo;
|
|
foo.x = 41;
|
|
some_function(foo.x);
|
|
return foo;
|
|
}
|
|
|
|
int main() {
|
|
Foo bar = getFoo();
|
|
return bar.x;
|
|
}
|
|
|
|
// Check that NRVO variables are stored as a pointer with deref if they are
|
|
// stored in the return register.
|
|
|
|
// CHECK: %[[RESULT:.*]] = alloca ptr, align 8
|
|
// CHECK: #dbg_declare(ptr %[[RESULT]],
|
|
// CHECK-SAME: !DIExpression(DW_OP_deref)
|
|
|
|
// NOELIDE: %[[FOO:.*]] = alloca %struct.Foo, align 4
|
|
// NOELIDE: #dbg_declare(ptr %[[FOO]],
|
|
// NOELIDE-SAME: !DIExpression()
|