forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debug info: Emit objc_direct methods as members of their containing c…
…lass even in DWARF 4 and earlier. This allows the debugger to recognize them as direct functions as opposed to Objective-C methods. <rdar://problem/57327663> Differential Revision: https://reviews.llvm.org/D70544
- Loading branch information
1 parent
ab41180
commit e0cabe2
Showing
3 changed files
with
50 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// RUN: %clang_cc1 -dwarf-version=5 -emit-llvm -debug-info-kind=limited -w -triple x86_64-apple-darwin10 %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -dwarf-version=4 -emit-llvm -debug-info-kind=limited -w -triple x86_64-apple-darwin10 %s -o - | FileCheck %s | ||
|
||
__attribute__((objc_root_class)) | ||
@interface Root | ||
@end | ||
|
||
@implementation Root | ||
- (int)getInt __attribute__((objc_direct)) { | ||
return 42; | ||
} | ||
@end | ||
|
||
// Test that objc_direct methods are always (even in DWARF < 5) emitted | ||
// as members of their containing class. | ||
|
||
// CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Root", | ||
// CHECK-SAME: elements: ![[MEMBERS:[0-9]+]], | ||
// CHECK-SAME: runtimeLang: DW_LANG_ObjC) | ||
// CHECK: ![[MEMBERS]] = !{![[GETTER:[0-9]+]]} | ||
// CHECK: ![[GETTER]] = !DISubprogram(name: "-[Root getInt]", |