From 1ba1a8b304ad92401a8cc28960b6fd410d4052b1 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 8 Dec 2016 17:46:57 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289080 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ObjectYAML/DWARFYAML.h | 32 ++++++++++++++--------------- include/llvm/ObjectYAML/MachOYAML.h | 2 +- lib/ObjectYAML/DWARFYAML.cpp | 14 ++++++------- tools/obj2yaml/dwarf2yaml.cpp | 10 ++++----- tools/obj2yaml/obj2yaml.h | 4 ++-- tools/yaml2obj/yaml2dwarf.cpp | 4 ++-- tools/yaml2obj/yaml2obj.h | 6 +++--- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/include/llvm/ObjectYAML/DWARFYAML.h b/include/llvm/ObjectYAML/DWARFYAML.h index 8ad32302f19..e234b628f4c 100644 --- a/include/llvm/ObjectYAML/DWARFYAML.h +++ b/include/llvm/ObjectYAML/DWARFYAML.h @@ -23,48 +23,48 @@ namespace llvm { namespace DWARFYAML { -struct DWARFAttributeAbbrev { +struct AttributeAbbrev { llvm::dwarf::Attribute Attribute; llvm::dwarf::Form Form; }; -struct DWARFAbbrev { +struct Abbrev { llvm::yaml::Hex32 Code; llvm::dwarf::Tag Tag; llvm::dwarf::Constants Children; - std::vector Attributes; + std::vector Attributes; }; -struct DWARFData { - std::vector AbbrevDecls; +struct Data { + std::vector AbbrevDecls; std::vector DebugStrings; bool isEmpty() const; -}; +}; } // namespace llvm::DWARFYAML } // namespace llvm LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef) -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DWARFAttributeAbbrev) -LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DWARFAbbrev) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AttributeAbbrev) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Abbrev) namespace llvm { namespace yaml { -template <> struct MappingTraits { - static void mapping(IO &IO, DWARFYAML::DWARFData &DWARF); +template <> struct MappingTraits { + static void mapping(IO &IO, DWARFYAML::Data &DWARF); }; -template <> struct MappingTraits { - static void mapping(IO &IO, DWARFYAML::DWARFAbbrev &Abbrev); +template <> struct MappingTraits { + static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev); }; -template <> struct MappingTraits { - static void mapping(IO &IO, DWARFYAML::DWARFAttributeAbbrev &AttAbbrev); +template <> struct MappingTraits { + 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); template <> struct ScalarEnumerationTraits { @@ -84,7 +84,7 @@ template <> struct ScalarEnumerationTraits { } }; -#define HANDLE_DW_FORM(unused, name) \ +#define HANDLE_DW_FORM(unused, name) \ io.enumCase(value, "DW_FORM_" #name, dwarf::DW_FORM_##name); template <> struct ScalarEnumerationTraits { diff --git a/include/llvm/ObjectYAML/MachOYAML.h b/include/llvm/ObjectYAML/MachOYAML.h index b28666c5996..657973dd7bb 100644 --- a/include/llvm/ObjectYAML/MachOYAML.h +++ b/include/llvm/ObjectYAML/MachOYAML.h @@ -110,7 +110,7 @@ struct Object { std::vector LoadCommands; std::vector
Sections; LinkEditData LinkEdit; - DWARFYAML::DWARFData DWARF; + DWARFYAML::Data DWARF; }; struct FatHeader { diff --git a/lib/ObjectYAML/DWARFYAML.cpp b/lib/ObjectYAML/DWARFYAML.cpp index a5f0255e338..ca04e2e2687 100644 --- a/lib/ObjectYAML/DWARFYAML.cpp +++ b/lib/ObjectYAML/DWARFYAML.cpp @@ -16,28 +16,28 @@ namespace llvm { -bool DWARFYAML::DWARFData::isEmpty() const { +bool DWARFYAML::Data::isEmpty() const { return 0 == DebugStrings.size() + AbbrevDecls.size(); } namespace yaml { -void MappingTraits::mapping( - IO &IO, DWARFYAML::DWARFData &DWARF) { +void MappingTraits::mapping( + IO &IO, DWARFYAML::Data &DWARF) { IO.mapOptional("debug_str", DWARF.DebugStrings); IO.mapOptional("debug_abbrev", DWARF.AbbrevDecls); } -void MappingTraits::mapping( - IO &IO, DWARFYAML::DWARFAbbrev &Abbrev) { +void MappingTraits::mapping( + IO &IO, DWARFYAML::Abbrev &Abbrev) { IO.mapRequired("Code", Abbrev.Code); IO.mapRequired("Tag", Abbrev.Tag); IO.mapRequired("Children", Abbrev.Children); IO.mapRequired("Attributes", Abbrev.Attributes); } -void MappingTraits::mapping( - IO &IO, DWARFYAML::DWARFAttributeAbbrev &AttAbbrev) { +void MappingTraits::mapping( + IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev) { IO.mapRequired("Attribute", AttAbbrev.Attribute); IO.mapRequired("Form", AttAbbrev.Form); } diff --git a/tools/obj2yaml/dwarf2yaml.cpp b/tools/obj2yaml/dwarf2yaml.cpp index 99c12b2cd72..112d62621de 100644 --- a/tools/obj2yaml/dwarf2yaml.cpp +++ b/tools/obj2yaml/dwarf2yaml.cpp @@ -13,18 +13,18 @@ using namespace llvm; -void dumpDebugAbbrev(DWARFContextInMemory &DCtx, DWARFYAML::DWARFData &Y) { +void dumpDebugAbbrev(DWARFContextInMemory &DCtx, DWARFYAML::Data &Y) { auto AbbrevSetPtr = DCtx.getDebugAbbrev(); if (AbbrevSetPtr) { for (auto AbbrvDeclSet : *AbbrevSetPtr) { for (auto AbbrvDecl : AbbrvDeclSet.second) { - DWARFYAML::DWARFAbbrev Abbrv; + DWARFYAML::Abbrev Abbrv; Abbrv.Code = AbbrvDecl.getCode(); Abbrv.Tag = AbbrvDecl.getTag(); Abbrv.Children = AbbrvDecl.hasChildren() ? dwarf::DW_CHILDREN_yes : dwarf::DW_CHILDREN_no; for (auto Attribute : AbbrvDecl.attributes()) { - DWARFYAML::DWARFAttributeAbbrev AttAbrv; + DWARFYAML::AttributeAbbrev AttAbrv; AttAbrv.Attribute = Attribute.Attr; AttAbrv.Form = Attribute.Form; 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(); while (RemainingTable.size() > 0) { auto SymbolPair = RemainingTable.split('\0'); @@ -45,7 +45,7 @@ void dumpDebugStrings(DWARFContextInMemory &DCtx, DWARFYAML::DWARFData &Y) { } std::error_code dwarf2yaml(DWARFContextInMemory &DCtx, - DWARFYAML::DWARFData &Y) { + DWARFYAML::Data &Y) { dumpDebugAbbrev(DCtx, Y); dumpDebugStrings(DCtx, Y); diff --git a/tools/obj2yaml/obj2yaml.h b/tools/obj2yaml/obj2yaml.h index 0711233d626..70d4ebdd3d1 100644 --- a/tools/obj2yaml/obj2yaml.h +++ b/tools/obj2yaml/obj2yaml.h @@ -28,11 +28,11 @@ std::error_code macho2yaml(llvm::raw_ostream &Out, namespace llvm { class DWARFContextInMemory; namespace DWARFYAML { -struct DWARFData; +struct Data; } } std::error_code dwarf2yaml(llvm::DWARFContextInMemory &DCtx, - llvm::DWARFYAML::DWARFData &Y); + llvm::DWARFYAML::Data &Y); #endif diff --git a/tools/yaml2obj/yaml2dwarf.cpp b/tools/yaml2obj/yaml2dwarf.cpp index 9e869996367..deef9a1d98b 100644 --- a/tools/yaml2obj/yaml2dwarf.cpp +++ b/tools/yaml2obj/yaml2dwarf.cpp @@ -19,14 +19,14 @@ 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) { OS.write(Str.data(), Str.size()); 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) { encodeULEB128(AbbrevDecl.Code, OS); encodeULEB128(AbbrevDecl.Tag, OS); diff --git a/tools/yaml2obj/yaml2obj.h b/tools/yaml2obj/yaml2obj.h index 55edf33a2be..f54ffe57c0b 100644 --- a/tools/yaml2obj/yaml2obj.h +++ b/tools/yaml2obj/yaml2obj.h @@ -24,7 +24,7 @@ struct Object; } namespace DWARFYAML { -struct DWARFData; +struct Data; } 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); void yaml2debug_abbrev(llvm::raw_ostream &OS, - const llvm::DWARFYAML::DWARFData &DI); + const llvm::DWARFYAML::Data &DI); void yaml2debug_str(llvm::raw_ostream &OS, - const llvm::DWARFYAML::DWARFData &DI); + const llvm::DWARFYAML::Data &DI); #endif