//===----------------------------------------------------------------------===//
// TODO: Add other DW-based macros.
-#if !( \
- defined HANDLE_DW_TAG || defined HANDLE_DW_AT || defined HANDLE_DW_FORM || \
- defined HANDLE_DW_OP || defined HANDLE_DW_LANG || defined HANDLE_DW_ATE || \
- defined HANDLE_DW_VIRTUALITY || defined HANDLE_DW_DEFAULTED || \
- defined HANDLE_DW_CC || defined HANDLE_DW_LNCT || \
- defined HANDLE_DW_MACRO || defined HANDLE_DW_RLE || defined HANDLE_DW_CFA)
+#if !(defined HANDLE_DW_TAG || defined HANDLE_DW_AT || \
+ defined HANDLE_DW_FORM || defined HANDLE_DW_OP || \
+ defined HANDLE_DW_LANG || defined HANDLE_DW_ATE || \
+ defined HANDLE_DW_VIRTUALITY || defined HANDLE_DW_DEFAULTED || \
+ defined HANDLE_DW_CC || defined HANDLE_DW_LNCT || \
+ defined HANDLE_DW_MACRO || defined HANDLE_DW_RLE || \
+ defined HANDLE_DW_CFA || defined HANDLE_DW_APPLE_PROPERTY)
#error "Missing macro definition of HANDLE_DW*"
#endif
#define HANDLE_DW_CFA(ID, NAME)
#endif
+#ifndef HANDLE_DW_APPLE_PROPERTY
+#define HANDLE_DW_APPLE_PROPERTY(ID, NAME)
+#endif
+
HANDLE_DW_TAG(0x0000, null)
HANDLE_DW_TAG(0x0001, array_type)
HANDLE_DW_TAG(0x0002, class_type)
HANDLE_DW_CFA(0x2d, GNU_window_save)
HANDLE_DW_CFA(0x2e, GNU_args_size)
+// Apple Objective-C Property Attributes.
+// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind!
+HANDLE_DW_APPLE_PROPERTY(0x01, readonly)
+HANDLE_DW_APPLE_PROPERTY(0x02, getter)
+HANDLE_DW_APPLE_PROPERTY(0x04, assign)
+HANDLE_DW_APPLE_PROPERTY(0x08, readwrite)
+HANDLE_DW_APPLE_PROPERTY(0x10, retain)
+HANDLE_DW_APPLE_PROPERTY(0x20, copy)
+HANDLE_DW_APPLE_PROPERTY(0x40, nonatomic)
+HANDLE_DW_APPLE_PROPERTY(0x80, setter)
+HANDLE_DW_APPLE_PROPERTY(0x100, atomic)
+HANDLE_DW_APPLE_PROPERTY(0x200, weak)
+HANDLE_DW_APPLE_PROPERTY(0x400, strong)
+HANDLE_DW_APPLE_PROPERTY(0x800, unsafe_unretained)
+HANDLE_DW_APPLE_PROPERTY(0x1000, nullability)
+HANDLE_DW_APPLE_PROPERTY(0x2000, null_resettable)
+HANDLE_DW_APPLE_PROPERTY(0x4000, class)
+
+
#undef HANDLE_DW_TAG
#undef HANDLE_DW_AT
#undef HANDLE_DW_FORM
#undef HANDLE_DW_MACRO
#undef HANDLE_DW_RLE
#undef HANDLE_DW_CFA
+#undef HANDLE_DW_APPLE_PROPERTY
};
/// Constants for the DW_APPLE_PROPERTY_attributes attribute.
-/// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind.
+/// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind!
enum ApplePropertyAttributes {
- // Apple Objective-C Property Attributes
- DW_APPLE_PROPERTY_readonly = 0x01,
- DW_APPLE_PROPERTY_getter = 0x02,
- DW_APPLE_PROPERTY_assign = 0x04,
- DW_APPLE_PROPERTY_readwrite = 0x08,
- DW_APPLE_PROPERTY_retain = 0x10,
- DW_APPLE_PROPERTY_copy = 0x20,
- DW_APPLE_PROPERTY_nonatomic = 0x40,
- DW_APPLE_PROPERTY_setter = 0x80,
- DW_APPLE_PROPERTY_atomic = 0x100,
- DW_APPLE_PROPERTY_weak = 0x200,
- 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
+#define HANDLE_DW_APPLE_PROPERTY(ID, NAME) DW_APPLE_PROPERTY_##NAME = ID,
+#include "llvm/Support/Dwarf.def"
};
// Constants for the DWARF5 Accelerator Table Proposal
StringRef llvm::dwarf::ApplePropertyString(unsigned Prop) {
switch (Prop) {
- case DW_APPLE_PROPERTY_readonly:
- return "DW_APPLE_PROPERTY_readonly";
- case DW_APPLE_PROPERTY_getter:
- return "DW_APPLE_PROPERTY_getter";
- case DW_APPLE_PROPERTY_assign:
- return "DW_APPLE_PROPERTY_assign";
- case DW_APPLE_PROPERTY_readwrite:
- return "DW_APPLE_PROPERTY_readwrite";
- case DW_APPLE_PROPERTY_retain:
- return "DW_APPLE_PROPERTY_retain";
- case DW_APPLE_PROPERTY_copy:
- return "DW_APPLE_PROPERTY_copy";
- case DW_APPLE_PROPERTY_nonatomic:
- return "DW_APPLE_PROPERTY_nonatomic";
- case DW_APPLE_PROPERTY_setter:
- return "DW_APPLE_PROPERTY_setter";
- case DW_APPLE_PROPERTY_atomic:
- return "DW_APPLE_PROPERTY_atomic";
- case DW_APPLE_PROPERTY_weak:
- return "DW_APPLE_PROPERTY_weak";
- case DW_APPLE_PROPERTY_strong:
- 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";
+ default:
+ return StringRef();
+#define HANDLE_DW_APPLE_PROPERTY(ID, NAME) \
+ case DW_APPLE_PROPERTY_##NAME: \
+ return "DW_APPLE_PROPERTY_" #NAME;
+#include "llvm/Support/Dwarf.def"
}
- return StringRef();
}
StringRef llvm::dwarf::AtomTypeString(unsigned AT) {