Add ApplePropertyString dump helper to Dwarf.{h|cpp}.
authorFrederic Riss <friss@apple.com>
Thu, 9 Oct 2014 20:43:04 +0000 (20:43 +0000)
committerFrederic Riss <friss@apple.com>
Thu, 9 Oct 2014 20:43:04 +0000 (20:43 +0000)
Reviewers: dblaikie

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5688

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219442 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Dwarf.h
lib/Support/Dwarf.cpp

index c38a3474dee7be4f05877e180c0f695054d944af..7da5d9c2544de5c56df0dc94a3d006207deddb5d 100644 (file)
@@ -882,6 +882,11 @@ const char *MacinfoString(unsigned Encoding);
 /// encodings.
 const char *CallFrameString(unsigned Encoding);
 
+/// ApplePropertyString - Return the string for the specified Apple
+/// property bit. This function is meant to return the symbolic name
+/// for 1 bit of the DW_AT_APPLE_property attribute, not for the whole attribute.
+const char *ApplePropertyString(unsigned);
+
 // Constants for the DWARF5 Accelerator Table Proposal
 enum AcceleratorTable {
   // Data layout descriptors.
index 1a8f4a1ec2e6cd2b4a6747b05df936749d401bee..9c80fb0d3b3ae42b2846226be13495be096a0e6a 100644 (file)
@@ -750,6 +750,39 @@ const char *llvm::dwarf::CallFrameString(unsigned Encoding) {
   return nullptr;
 }
 
+/// ApplePropertyString - Return the string for the specified Apple
+/// property bit. This function is meant to return the symbolic name
+/// for 1 bit of the DW_AT_APPLE_property attribute, not for the whole attribute.
+const char *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";
+  }
+  return nullptr;
+}
+
 const char *llvm::dwarf::AtomTypeString(unsigned AT) {
   switch (AT) {
   case dwarf::DW_ATOM_null: