Add ApplePropertyString dump helper to Dwarf.{h|cpp}.

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
This commit is contained in:
Frederic Riss 2014-10-09 20:43:04 +00:00
parent f75bfbea17
commit 0d807ccc39
2 changed files with 38 additions and 0 deletions

View 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.

View 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: