[llvm] r275354 - Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind.
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 13 17:41:19 PDT 2016
Author: adrian
Date: Wed Jul 13 19:41:18 2016
New Revision: 275354
URL: http://llvm.org/viewvc/llvm-project?rev=275354&view=rev
Log:
Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind.
This adds Clang-specific DWARF constants for nullability and ObjC
class properties that are already generated by clang. This patch adds
dwarfdump support and a more comprehensive testcase.
<rdar://problem/27335745>
Modified:
llvm/trunk/docs/SourceLevelDebugging.rst
llvm/trunk/include/llvm/Support/Dwarf.h
llvm/trunk/lib/Support/Dwarf.cpp
llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m
llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o
llvm/trunk/test/DebugInfo/dwarfdump-accel.test
llvm/trunk/test/DebugInfo/dwarfdump-objc.test
Modified: llvm/trunk/docs/SourceLevelDebugging.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.rst?rev=275354&r1=275353&r2=275354&view=diff
==============================================================================
--- llvm/trunk/docs/SourceLevelDebugging.rst (original)
+++ llvm/trunk/docs/SourceLevelDebugging.rst Wed Jul 13 19:41:18 2016
@@ -681,7 +681,13 @@ New DWARF Constants
| DW_APPLE_PROPERTY_strong | 0x400 |
+--------------------------------------+-------+
| DW_APPLE_PROPERTY_unsafe_unretained | 0x800 |
-+--------------------------------+-----+-------+
++--------------------------------------+-------+
+| DW_APPLE_PROPERTY_nullability | 0x1000|
++--------------------------------------+-------+
+| DW_APPLE_PROPERTY_null_resettable | 0x2000|
++--------------------------------------+-------+
+| DW_APPLE_PROPERTY_class | 0x4000|
++--------------------------------------+-------+
Name Accelerator Tables
-----------------------
Modified: llvm/trunk/include/llvm/Support/Dwarf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Dwarf.h?rev=275354&r1=275353&r2=275354&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Dwarf.h (original)
+++ llvm/trunk/include/llvm/Support/Dwarf.h Wed Jul 13 19:41:18 2016
@@ -538,7 +538,7 @@ enum LocationListEntry : unsigned char {
DW_LLE_offset_pair_entry
};
-/// Contstants for the DW_APPLE_PROPERTY_attributes attribute.
+/// Constants for the DW_APPLE_PROPERTY_attributes attribute.
/// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind.
enum ApplePropertyAttributes {
// Apple Objective-C Property Attributes
@@ -553,7 +553,10 @@ enum ApplePropertyAttributes {
DW_APPLE_PROPERTY_atomic = 0x100,
DW_APPLE_PROPERTY_weak = 0x200,
DW_APPLE_PROPERTY_strong = 0x400,
- DW_APPLE_PROPERTY_unsafe_unretained = 0x800
+ DW_APPLE_PROPERTY_unsafe_unretained = 0x800,
+ DW_APPLE_PROPERTY_nullability = 0x1000,
+ DW_APPLE_PROPERTY_null_resettable = 0x2000,
+ DW_APPLE_PROPERTY_class = 0x4000
};
// Constants for the DWARF5 Accelerator Table Proposal
Modified: llvm/trunk/lib/Support/Dwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Dwarf.cpp?rev=275354&r1=275353&r2=275354&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Dwarf.cpp (original)
+++ llvm/trunk/lib/Support/Dwarf.cpp Wed Jul 13 19:41:18 2016
@@ -545,6 +545,12 @@ const char *llvm::dwarf::ApplePropertySt
return "DW_APPLE_PROPERTY_strong";
case DW_APPLE_PROPERTY_unsafe_unretained:
return "DW_APPLE_PROPERTY_unsafe_unretained";
+ case DW_APPLE_PROPERTY_nullability:
+ return "DW_APPLE_PROPERTY_nullability";
+ case DW_APPLE_PROPERTY_null_resettable:
+ return "DW_APPLE_PROPERTY_null_resettable";
+ case DW_APPLE_PROPERTY_class:
+ return "DW_APPLE_PROPERTY_class";
}
return nullptr;
}
Modified: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m?rev=275354&r1=275353&r2=275354&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m (original)
+++ llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.m Wed Jul 13 19:41:18 2016
@@ -10,6 +10,12 @@
@property (retain) NSObject *Retain;
@property (copy) NSObject *Copy;
@property (nonatomic) int NonAtomic;
+ at property (atomic) int Atomic;
+ at property (strong) NSObject *Strong;
+ at property (unsafe_unretained) id UnsafeUnretained;
+ at property (nullable) NSObject *Nullability;
+ at property (null_resettable) NSObject *NullResettable;
+ at property (class) int ClassProperty;
@end
@implementation TestInterface
Modified: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o?rev=275354&r1=275353&r2=275354&view=diff
==============================================================================
Binary files llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o (original) and llvm/trunk/test/DebugInfo/Inputs/dwarfdump-objc.x86_64.o Wed Jul 13 19:41:18 2016 differ
Modified: llvm/trunk/test/DebugInfo/dwarfdump-accel.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-accel.test?rev=275354&r1=275353&r2=275354&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/dwarfdump-accel.test (original)
+++ llvm/trunk/test/DebugInfo/dwarfdump-accel.test Wed Jul 13 19:41:18 2016
@@ -21,28 +21,30 @@ CHECK: .apple_names contents:
CHECK: Magic = 0x48415348
CHECK: Version = 0x0001
CHECK: Hash function = 0x00000000
-CHECK: Bucket count = 11
-CHECK: Hashes count = 22
+CHECK: Bucket count = 21
+CHECK: Hashes count = 42
CHECK: HeaderData length = 12
CHECK: DIE offset base = 0
CHECK: Number of atoms = 1
CHECK: Atom[0] Type: DW_ATOM_die_offset Form: DW_FORM_data4
+Check that the accelerators point to the right DIEs.
+CHECK: Name:{{.*}}"-[TestInterface ReadOnly]"
+CHECK-NOT: Name
+CHECK: {Atom[0]: [[READONLY]]}
+
Check that empty buckets are handled correctly.
-CHECK: Bucket[2]
-CHECK: EMPTY
CHECK: Bucket[3]
+CHECK: EMPTY
+CHECK: Bucket[4]
Check that the accelerators point to the right DIEs.
-CHECK: Name:{{.*}}"-[TestInterface ReadOnly]"
+CHECK: Name:{{.*}}"-[TestInterface Assign]"
CHECK-NOT: Name
-CHECK: {Atom[0]: [[READONLY]]}
+CHECK: {Atom[0]: [[ASSIGN]]}
CHECK: Name:{{.*}}"-[TestInterface setAssign:]"
CHECK-NOT: Name
CHECK: {Atom[0]: [[SETASSIGN]]}
-CHECK: Name:{{.*}}"-[TestInterface Assign]"
-CHECK-NOT: Name
-CHECK: {Atom[0]: [[ASSIGN]]}
Check that types are referenced correctly.
CHECK: .apple_types contents:
@@ -50,7 +52,7 @@ CHECK: Name{{.*}}"TestInterface"
CHECK-NOT: Name
CHECK: {Atom[0]: [[TESTINTERFACE]]}
-Check that an empty ecceleratorsection is handled correctly.
+Check that an empty accelerator section is handled correctly.
CHECK: .apple_namespaces contents:
CHECK-NOT: Magic
Modified: llvm/trunk/test/DebugInfo/dwarfdump-objc.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-objc.test?rev=275354&r1=275353&r2=275354&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/dwarfdump-objc.test (original)
+++ llvm/trunk/test/DebugInfo/dwarfdump-objc.test Wed Jul 13 19:41:18 2016
@@ -6,35 +6,70 @@ CHECK: DW_TAG_APPLE_property
CHECK-NOT: TAG
CHECK: DW_AT_APPLE_property_name {{.*}} "ReadOnly"
CHECK-NOT: TAG
-CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x01 (DW_APPLE_PROPERTY_readonly))
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x0101 (DW_APPLE_PROPERTY_readonly, DW_APPLE_PROPERTY_atomic))
CHECK: DW_TAG_APPLE_property
CHECK-NOT: TAG
CHECK: DW_AT_APPLE_property_name {{.*}} "Assign"
CHECK-NOT: TAG
-CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x0c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite))
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x090c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_atomic, DW_APPLE_PROPERTY_unsafe_unretained))
CHECK: DW_TAG_APPLE_property
CHECK-NOT: TAG
CHECK: DW_AT_APPLE_property_name {{.*}} "ReadWrite"
CHECK-NOT: TAG
-CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x0c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite))
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x090c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_atomic, DW_APPLE_PROPERTY_unsafe_unretained))
CHECK: DW_TAG_APPLE_property
CHECK-NOT: TAG
CHECK: DW_AT_APPLE_property_name {{.*}} "Retain"
CHECK-NOT: TAG
-CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x18 (DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_retain))
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x0118 (DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_retain, DW_APPLE_PROPERTY_atomic))
CHECK: DW_TAG_APPLE_property
CHECK-NOT: TAG
CHECK: DW_AT_APPLE_property_name {{.*}} "Copy"
CHECK-NOT: TAG
-CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x28 (DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_copy))
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x0128 (DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_copy, DW_APPLE_PROPERTY_atomic))
CHECK: DW_TAG_APPLE_property
CHECK-NOT: TAG
CHECK: DW_AT_APPLE_property_name {{.*}} "NonAtomic"
CHECK-NOT: TAG
-CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x4c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_nonatomic))
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x084c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_nonatomic, DW_APPLE_PROPERTY_unsafe_unretained))
+CHECK: DW_TAG_APPLE_property
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_name {{.*}} "Atomic"
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x090c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_atomic, DW_APPLE_PROPERTY_unsafe_unretained))
+
+CHECK: DW_TAG_APPLE_property
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_name {{.*}} "Strong"
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x0508 (DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_atomic, DW_APPLE_PROPERTY_strong))
+
+CHECK: DW_TAG_APPLE_property
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_name {{.*}} "UnsafeUnretained"
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x090c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_atomic, DW_APPLE_PROPERTY_unsafe_unretained))
+
+CHECK: DW_TAG_APPLE_property
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_name {{.*}} "Nullability"
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x190c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_atomic, DW_APPLE_PROPERTY_unsafe_unretained, DW_APPLE_PROPERTY_nullability))
+
+CHECK: DW_TAG_APPLE_property
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_name {{.*}} "NullResettable"
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x390c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_atomic, DW_APPLE_PROPERTY_unsafe_unretained, DW_APPLE_PROPERTY_nullability, DW_APPLE_PROPERTY_null_resettable))
+
+CHECK: DW_TAG_APPLE_property
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_name {{.*}} "ClassProperty"
+CHECK-NOT: TAG
+CHECK: DW_AT_APPLE_property_attribute {{.*}} (0x490c (DW_APPLE_PROPERTY_assign, DW_APPLE_PROPERTY_readwrite, DW_APPLE_PROPERTY_atomic, DW_APPLE_PROPERTY_unsafe_unretained, DW_APPLE_PROPERTY_class))
More information about the llvm-commits
mailing list