mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[ObjectYAML] Remove DWARF from class names
Since all the DWARF classes are in a DWARFYAML namespace having every class start with DWARF seems like a bit of overkill. llvm-svn: 289080
This commit is contained in:
parent
3a9e77fc0f
commit
b3763fa573
@ -23,48 +23,48 @@
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace DWARFYAML {
|
namespace DWARFYAML {
|
||||||
|
|
||||||
struct DWARFAttributeAbbrev {
|
struct AttributeAbbrev {
|
||||||
llvm::dwarf::Attribute Attribute;
|
llvm::dwarf::Attribute Attribute;
|
||||||
llvm::dwarf::Form Form;
|
llvm::dwarf::Form Form;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DWARFAbbrev {
|
struct Abbrev {
|
||||||
llvm::yaml::Hex32 Code;
|
llvm::yaml::Hex32 Code;
|
||||||
llvm::dwarf::Tag Tag;
|
llvm::dwarf::Tag Tag;
|
||||||
llvm::dwarf::Constants Children;
|
llvm::dwarf::Constants Children;
|
||||||
std::vector<DWARFAttributeAbbrev> Attributes;
|
std::vector<AttributeAbbrev> Attributes;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DWARFData {
|
struct Data {
|
||||||
std::vector<DWARFAbbrev> AbbrevDecls;
|
std::vector<Abbrev> AbbrevDecls;
|
||||||
std::vector<StringRef> DebugStrings;
|
std::vector<StringRef> DebugStrings;
|
||||||
|
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace llvm::DWARFYAML
|
} // namespace llvm::DWARFYAML
|
||||||
} // namespace llvm
|
} // namespace llvm
|
||||||
|
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef)
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef)
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DWARFAttributeAbbrev)
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AttributeAbbrev)
|
||||||
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DWARFAbbrev)
|
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Abbrev)
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace yaml {
|
namespace yaml {
|
||||||
|
|
||||||
template <> struct MappingTraits<DWARFYAML::DWARFData> {
|
template <> struct MappingTraits<DWARFYAML::Data> {
|
||||||
static void mapping(IO &IO, DWARFYAML::DWARFData &DWARF);
|
static void mapping(IO &IO, DWARFYAML::Data &DWARF);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct MappingTraits<DWARFYAML::DWARFAbbrev> {
|
template <> struct MappingTraits<DWARFYAML::Abbrev> {
|
||||||
static void mapping(IO &IO, DWARFYAML::DWARFAbbrev &Abbrev);
|
static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct MappingTraits<DWARFYAML::DWARFAttributeAbbrev> {
|
template <> struct MappingTraits<DWARFYAML::AttributeAbbrev> {
|
||||||
static void mapping(IO &IO, DWARFYAML::DWARFAttributeAbbrev &AttAbbrev);
|
static void mapping(IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HANDLE_DW_TAG(unused, name) \
|
#define HANDLE_DW_TAG(unused, name) \
|
||||||
io.enumCase(value, "DW_TAG_" #name, dwarf::DW_TAG_##name);
|
io.enumCase(value, "DW_TAG_" #name, dwarf::DW_TAG_##name);
|
||||||
|
|
||||||
template <> struct ScalarEnumerationTraits<dwarf::Tag> {
|
template <> struct ScalarEnumerationTraits<dwarf::Tag> {
|
||||||
@ -84,7 +84,7 @@ template <> struct ScalarEnumerationTraits<dwarf::Attribute> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HANDLE_DW_FORM(unused, name) \
|
#define HANDLE_DW_FORM(unused, name) \
|
||||||
io.enumCase(value, "DW_FORM_" #name, dwarf::DW_FORM_##name);
|
io.enumCase(value, "DW_FORM_" #name, dwarf::DW_FORM_##name);
|
||||||
|
|
||||||
template <> struct ScalarEnumerationTraits<dwarf::Form> {
|
template <> struct ScalarEnumerationTraits<dwarf::Form> {
|
||||||
|
@ -110,7 +110,7 @@ struct Object {
|
|||||||
std::vector<LoadCommand> LoadCommands;
|
std::vector<LoadCommand> LoadCommands;
|
||||||
std::vector<Section> Sections;
|
std::vector<Section> Sections;
|
||||||
LinkEditData LinkEdit;
|
LinkEditData LinkEdit;
|
||||||
DWARFYAML::DWARFData DWARF;
|
DWARFYAML::Data DWARF;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FatHeader {
|
struct FatHeader {
|
||||||
|
@ -16,28 +16,28 @@
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
bool DWARFYAML::DWARFData::isEmpty() const {
|
bool DWARFYAML::Data::isEmpty() const {
|
||||||
return 0 == DebugStrings.size() + AbbrevDecls.size();
|
return 0 == DebugStrings.size() + AbbrevDecls.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace yaml {
|
namespace yaml {
|
||||||
|
|
||||||
void MappingTraits<DWARFYAML::DWARFData>::mapping(
|
void MappingTraits<DWARFYAML::Data>::mapping(
|
||||||
IO &IO, DWARFYAML::DWARFData &DWARF) {
|
IO &IO, DWARFYAML::Data &DWARF) {
|
||||||
IO.mapOptional("debug_str", DWARF.DebugStrings);
|
IO.mapOptional("debug_str", DWARF.DebugStrings);
|
||||||
IO.mapOptional("debug_abbrev", DWARF.AbbrevDecls);
|
IO.mapOptional("debug_abbrev", DWARF.AbbrevDecls);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MappingTraits<DWARFYAML::DWARFAbbrev>::mapping(
|
void MappingTraits<DWARFYAML::Abbrev>::mapping(
|
||||||
IO &IO, DWARFYAML::DWARFAbbrev &Abbrev) {
|
IO &IO, DWARFYAML::Abbrev &Abbrev) {
|
||||||
IO.mapRequired("Code", Abbrev.Code);
|
IO.mapRequired("Code", Abbrev.Code);
|
||||||
IO.mapRequired("Tag", Abbrev.Tag);
|
IO.mapRequired("Tag", Abbrev.Tag);
|
||||||
IO.mapRequired("Children", Abbrev.Children);
|
IO.mapRequired("Children", Abbrev.Children);
|
||||||
IO.mapRequired("Attributes", Abbrev.Attributes);
|
IO.mapRequired("Attributes", Abbrev.Attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MappingTraits<DWARFYAML::DWARFAttributeAbbrev>::mapping(
|
void MappingTraits<DWARFYAML::AttributeAbbrev>::mapping(
|
||||||
IO &IO, DWARFYAML::DWARFAttributeAbbrev &AttAbbrev) {
|
IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev) {
|
||||||
IO.mapRequired("Attribute", AttAbbrev.Attribute);
|
IO.mapRequired("Attribute", AttAbbrev.Attribute);
|
||||||
IO.mapRequired("Form", AttAbbrev.Form);
|
IO.mapRequired("Form", AttAbbrev.Form);
|
||||||
}
|
}
|
||||||
|
@ -13,18 +13,18 @@
|
|||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
void dumpDebugAbbrev(DWARFContextInMemory &DCtx, DWARFYAML::DWARFData &Y) {
|
void dumpDebugAbbrev(DWARFContextInMemory &DCtx, DWARFYAML::Data &Y) {
|
||||||
auto AbbrevSetPtr = DCtx.getDebugAbbrev();
|
auto AbbrevSetPtr = DCtx.getDebugAbbrev();
|
||||||
if (AbbrevSetPtr) {
|
if (AbbrevSetPtr) {
|
||||||
for (auto AbbrvDeclSet : *AbbrevSetPtr) {
|
for (auto AbbrvDeclSet : *AbbrevSetPtr) {
|
||||||
for (auto AbbrvDecl : AbbrvDeclSet.second) {
|
for (auto AbbrvDecl : AbbrvDeclSet.second) {
|
||||||
DWARFYAML::DWARFAbbrev Abbrv;
|
DWARFYAML::Abbrev Abbrv;
|
||||||
Abbrv.Code = AbbrvDecl.getCode();
|
Abbrv.Code = AbbrvDecl.getCode();
|
||||||
Abbrv.Tag = AbbrvDecl.getTag();
|
Abbrv.Tag = AbbrvDecl.getTag();
|
||||||
Abbrv.Children = AbbrvDecl.hasChildren() ? dwarf::DW_CHILDREN_yes
|
Abbrv.Children = AbbrvDecl.hasChildren() ? dwarf::DW_CHILDREN_yes
|
||||||
: dwarf::DW_CHILDREN_no;
|
: dwarf::DW_CHILDREN_no;
|
||||||
for (auto Attribute : AbbrvDecl.attributes()) {
|
for (auto Attribute : AbbrvDecl.attributes()) {
|
||||||
DWARFYAML::DWARFAttributeAbbrev AttAbrv;
|
DWARFYAML::AttributeAbbrev AttAbrv;
|
||||||
AttAbrv.Attribute = Attribute.Attr;
|
AttAbrv.Attribute = Attribute.Attr;
|
||||||
AttAbrv.Form = Attribute.Form;
|
AttAbrv.Form = Attribute.Form;
|
||||||
Abbrv.Attributes.push_back(AttAbrv);
|
Abbrv.Attributes.push_back(AttAbrv);
|
||||||
@ -35,7 +35,7 @@ void dumpDebugAbbrev(DWARFContextInMemory &DCtx, DWARFYAML::DWARFData &Y) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void dumpDebugStrings(DWARFContextInMemory &DCtx, DWARFYAML::DWARFData &Y) {
|
void dumpDebugStrings(DWARFContextInMemory &DCtx, DWARFYAML::Data &Y) {
|
||||||
StringRef RemainingTable = DCtx.getStringSection();
|
StringRef RemainingTable = DCtx.getStringSection();
|
||||||
while (RemainingTable.size() > 0) {
|
while (RemainingTable.size() > 0) {
|
||||||
auto SymbolPair = RemainingTable.split('\0');
|
auto SymbolPair = RemainingTable.split('\0');
|
||||||
@ -45,7 +45,7 @@ void dumpDebugStrings(DWARFContextInMemory &DCtx, DWARFYAML::DWARFData &Y) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::error_code dwarf2yaml(DWARFContextInMemory &DCtx,
|
std::error_code dwarf2yaml(DWARFContextInMemory &DCtx,
|
||||||
DWARFYAML::DWARFData &Y) {
|
DWARFYAML::Data &Y) {
|
||||||
dumpDebugAbbrev(DCtx, Y);
|
dumpDebugAbbrev(DCtx, Y);
|
||||||
dumpDebugStrings(DCtx, Y);
|
dumpDebugStrings(DCtx, Y);
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ std::error_code macho2yaml(llvm::raw_ostream &Out,
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
class DWARFContextInMemory;
|
class DWARFContextInMemory;
|
||||||
namespace DWARFYAML {
|
namespace DWARFYAML {
|
||||||
struct DWARFData;
|
struct Data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::error_code dwarf2yaml(llvm::DWARFContextInMemory &DCtx,
|
std::error_code dwarf2yaml(llvm::DWARFContextInMemory &DCtx,
|
||||||
llvm::DWARFYAML::DWARFData &Y);
|
llvm::DWARFYAML::Data &Y);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,14 +19,14 @@
|
|||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
void yaml2debug_str(raw_ostream &OS, const DWARFYAML::DWARFData &DI) {
|
void yaml2debug_str(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
||||||
for (auto Str : DI.DebugStrings) {
|
for (auto Str : DI.DebugStrings) {
|
||||||
OS.write(Str.data(), Str.size());
|
OS.write(Str.data(), Str.size());
|
||||||
OS.write('\0');
|
OS.write('\0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void yaml2debug_abbrev(raw_ostream &OS, const DWARFYAML::DWARFData &DI) {
|
void yaml2debug_abbrev(raw_ostream &OS, const DWARFYAML::Data &DI) {
|
||||||
for (auto AbbrevDecl : DI.AbbrevDecls) {
|
for (auto AbbrevDecl : DI.AbbrevDecls) {
|
||||||
encodeULEB128(AbbrevDecl.Code, OS);
|
encodeULEB128(AbbrevDecl.Code, OS);
|
||||||
encodeULEB128(AbbrevDecl.Tag, OS);
|
encodeULEB128(AbbrevDecl.Tag, OS);
|
||||||
|
@ -24,7 +24,7 @@ struct Object;
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace DWARFYAML {
|
namespace DWARFYAML {
|
||||||
struct DWARFData;
|
struct Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace yaml {
|
namespace yaml {
|
||||||
@ -38,8 +38,8 @@ int yaml2elf(llvm::ELFYAML::Object &Doc, llvm::raw_ostream &Out);
|
|||||||
int yaml2macho(llvm::yaml::YamlObjectFile &Doc, llvm::raw_ostream &Out);
|
int yaml2macho(llvm::yaml::YamlObjectFile &Doc, llvm::raw_ostream &Out);
|
||||||
|
|
||||||
void yaml2debug_abbrev(llvm::raw_ostream &OS,
|
void yaml2debug_abbrev(llvm::raw_ostream &OS,
|
||||||
const llvm::DWARFYAML::DWARFData &DI);
|
const llvm::DWARFYAML::Data &DI);
|
||||||
void yaml2debug_str(llvm::raw_ostream &OS,
|
void yaml2debug_str(llvm::raw_ostream &OS,
|
||||||
const llvm::DWARFYAML::DWARFData &DI);
|
const llvm::DWARFYAML::Data &DI);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user