[llvm] r219442 - Add ApplePropertyString dump helper to Dwarf.{h|cpp}.
Frederic Riss
friss at apple.com
Thu Oct 9 13:43:04 PDT 2014
Author: friss
Date: Thu Oct 9 15:43:04 2014
New Revision: 219442
URL: http://llvm.org/viewvc/llvm-project?rev=219442&view=rev
Log:
Add ApplePropertyString dump helper to Dwarf.{h|cpp}.
Reviewers: dblaikie
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5688
Modified:
llvm/trunk/include/llvm/Support/Dwarf.h
llvm/trunk/lib/Support/Dwarf.cpp
Modified: llvm/trunk/include/llvm/Support/Dwarf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Dwarf.h?rev=219442&r1=219441&r2=219442&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Dwarf.h (original)
+++ llvm/trunk/include/llvm/Support/Dwarf.h Thu Oct 9 15:43:04 2014
@@ -882,6 +882,11 @@ const char *MacinfoString(unsigned Encod
/// 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.
Modified: llvm/trunk/lib/Support/Dwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Dwarf.cpp?rev=219442&r1=219441&r2=219442&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Dwarf.cpp (original)
+++ llvm/trunk/lib/Support/Dwarf.cpp Thu Oct 9 15:43:04 2014
@@ -750,6 +750,39 @@ const char *llvm::dwarf::CallFrameString
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:
More information about the llvm-commits
mailing list