
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
82 lines
2.6 KiB
Objective-C
82 lines
2.6 KiB
Objective-C
// RUN: %clang_cc1 -emit-llvm -fblocks -debug-info-kind=limited -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed -x objective-c < %s -o - | FileCheck %s
|
|
|
|
// Test that we generate the proper debug location for a captured self.
|
|
// The second half of this test is in llvm/tests/DebugInfo/debug-info-blocks.ll
|
|
|
|
// CHECK: define {{.*}}_block_invoke
|
|
// CHECK: store ptr %.block_descriptor, ptr %[[ALLOCA:block.addr]], align
|
|
// CHECK-NEXT: #dbg_declare(ptr %d, ![[D:[0-9]+]], !{{.*}})
|
|
// CHECK-NEXT: #dbg_declare(ptr %[[ALLOCA]], ![[SELF:[0-9]+]], !{{.*}})
|
|
|
|
// Test that we do emit scope info for the helper functions, and that the
|
|
// parameters to these functions are marked as artificial (so the debugger
|
|
// doesn't accidentally step into the function).
|
|
// CHECK: define {{.*}} @__copy_helper_block_{{.*}}(ptr noundef %0, ptr noundef %1)
|
|
// CHECK-NOT: ret
|
|
// CHECK: #dbg_declare({{.+}}, ![[DBG_LINE:[0-9]+]]
|
|
// CHECK-NOT: ret
|
|
// CHECK: load {{.*}}, !dbg ![[DBG_LINE]]
|
|
// CHECK: ret {{.*}}, !dbg ![[DBG_LINE]]
|
|
// CHECK: define {{.*}} @__destroy_helper_block_{{.*}}(ptr
|
|
// CHECK-NOT: ret
|
|
// CHECK: load {{.*}}, !dbg ![[DESTROY_LINE:[0-9]+]]
|
|
// CHECK: ret {{.*}}, !dbg ![[DESTROY_LINE]]
|
|
|
|
// CHECK-DAG: [[DBG_LINE]] = !DILocation(line: 0, scope: ![[COPY_SP:[0-9]+]])
|
|
// CHECK-DAG: [[COPY_SP]] = distinct !DISubprogram(linkageName: "__copy_helper_block_
|
|
// CHECK-DAG: [[DESTROY_LINE]] = !DILocation(line: 0, scope: ![[DESTROY_SP:[0-9]+]])
|
|
// CHECK-DAG: [[DESTROY_SP]] = distinct !DISubprogram(linkageName: "__destroy_helper_block_
|
|
typedef unsigned int NSUInteger;
|
|
|
|
@protocol NSObject
|
|
@end
|
|
|
|
@interface NSObject <NSObject>
|
|
- (id)init;
|
|
+ (id)alloc;
|
|
@end
|
|
|
|
@interface NSDictionary : NSObject
|
|
- (NSUInteger)count;
|
|
@end
|
|
|
|
@interface NSMutableDictionary : NSDictionary
|
|
@end
|
|
|
|
@interface A : NSObject {
|
|
@public
|
|
int ivar;
|
|
}
|
|
@end
|
|
|
|
static void run(void (^block)(void))
|
|
{
|
|
block();
|
|
}
|
|
|
|
@implementation A
|
|
|
|
- (id)init
|
|
{
|
|
if ((self = [super init])) {
|
|
// CHECK-DAG: !DILocalVariable(arg: 1, scope: ![[COPY_SP]], {{.*}}, flags: DIFlagArtificial)
|
|
// CHECK-DAG: !DILocalVariable(arg: 2, scope: ![[COPY_SP]], {{.*}}, flags: DIFlagArtificial)
|
|
// CHECK-DAG: !DILocalVariable(arg: 1, scope: ![[DESTROY_SP]], {{.*}}, flags: DIFlagArtificial)
|
|
run(^{
|
|
// CHECK-DAG: ![[SELF]] = !DILocalVariable(name: "self", scope:{{.*}}, line: [[@LINE+4]],
|
|
// CHECK-DAG: ![[D]] = !DILocalVariable(name: "d", scope:{{.*}}, line: [[@LINE+1]],
|
|
NSMutableDictionary *d = [[NSMutableDictionary alloc] init];
|
|
ivar = 42 + (int)[d count];
|
|
});
|
|
}
|
|
return self;
|
|
}
|
|
|
|
@end
|
|
|
|
int main(void)
|
|
{
|
|
A *a = [[A alloc] init];
|
|
return 0;
|
|
}
|