[llvm] r289080 - [ObjectYAML] Remove DWARF from class names
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 8 09:46:57 PST 2016
Author: cbieneman
Date: Thu Dec 8 11:46:57 2016
New Revision: 289080
URL: http://llvm.org/viewvc/llvm-project?rev=289080&view=rev
Log:
[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.
Modified:
llvm/trunk/include/llvm/ObjectYAML/DWARFYAML.h
llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h
llvm/trunk/lib/ObjectYAML/DWARFYAML.cpp
llvm/trunk/tools/obj2yaml/dwarf2yaml.cpp
llvm/trunk/tools/obj2yaml/obj2yaml.h
llvm/trunk/tools/yaml2obj/yaml2dwarf.cpp
llvm/trunk/tools/yaml2obj/yaml2obj.h
Modified: llvm/trunk/include/llvm/ObjectYAML/DWARFYAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ObjectYAML/DWARFYAML.h?rev=289080&r1=289079&r2=289080&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ObjectYAML/DWARFYAML.h (original)
+++ llvm/trunk/include/llvm/ObjectYAML/DWARFYAML.h Thu Dec 8 11:46:57 2016
@@ -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<DWARFAttributeAbbrev> Attributes;
+ std::vector<AttributeAbbrev> Attributes;
};
-struct DWARFData {
- std::vector<DWARFAbbrev> AbbrevDecls;
+struct Data {
+ std::vector<Abbrev> AbbrevDecls;
std::vector<StringRef> 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<DWARFYAML::DWARFData> {
- static void mapping(IO &IO, DWARFYAML::DWARFData &DWARF);
+template <> struct MappingTraits<DWARFYAML::Data> {
+ static void mapping(IO &IO, DWARFYAML::Data &DWARF);
};
-template <> struct MappingTraits<DWARFYAML::DWARFAbbrev> {
- static void mapping(IO &IO, DWARFYAML::DWARFAbbrev &Abbrev);
+template <> struct MappingTraits<DWARFYAML::Abbrev> {
+ static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev);
};
-template <> struct MappingTraits<DWARFYAML::DWARFAttributeAbbrev> {
- static void mapping(IO &IO, DWARFYAML::DWARFAttributeAbbrev &AttAbbrev);
+template <> struct MappingTraits<DWARFYAML::AttributeAbbrev> {
+ 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<dwarf::Tag> {
@@ -84,7 +84,7 @@ template <> struct ScalarEnumerationTrai
}
};
-#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<dwarf::Form> {
Modified: llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h?rev=289080&r1=289079&r2=289080&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h (original)
+++ llvm/trunk/include/llvm/ObjectYAML/MachOYAML.h Thu Dec 8 11:46:57 2016
@@ -110,7 +110,7 @@ struct Object {
std::vector<LoadCommand> LoadCommands;
std::vector<Section> Sections;
LinkEditData LinkEdit;
- DWARFYAML::DWARFData DWARF;
+ DWARFYAML::Data DWARF;
};
struct FatHeader {
Modified: llvm/trunk/lib/ObjectYAML/DWARFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ObjectYAML/DWARFYAML.cpp?rev=289080&r1=289079&r2=289080&view=diff
==============================================================================
--- llvm/trunk/lib/ObjectYAML/DWARFYAML.cpp (original)
+++ llvm/trunk/lib/ObjectYAML/DWARFYAML.cpp Thu Dec 8 11:46:57 2016
@@ -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<DWARFYAML::DWARFData>::mapping(
- IO &IO, DWARFYAML::DWARFData &DWARF) {
+void MappingTraits<DWARFYAML::Data>::mapping(
+ IO &IO, DWARFYAML::Data &DWARF) {
IO.mapOptional("debug_str", DWARF.DebugStrings);
IO.mapOptional("debug_abbrev", DWARF.AbbrevDecls);
}
-void MappingTraits<DWARFYAML::DWARFAbbrev>::mapping(
- IO &IO, DWARFYAML::DWARFAbbrev &Abbrev) {
+void MappingTraits<DWARFYAML::Abbrev>::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<DWARFYAML::DWARFAttributeAbbrev>::mapping(
- IO &IO, DWARFYAML::DWARFAttributeAbbrev &AttAbbrev) {
+void MappingTraits<DWARFYAML::AttributeAbbrev>::mapping(
+ IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev) {
IO.mapRequired("Attribute", AttAbbrev.Attribute);
IO.mapRequired("Form", AttAbbrev.Form);
}
Modified: llvm/trunk/tools/obj2yaml/dwarf2yaml.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/dwarf2yaml.cpp?rev=289080&r1=289079&r2=289080&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/dwarf2yaml.cpp (original)
+++ llvm/trunk/tools/obj2yaml/dwarf2yaml.cpp Thu Dec 8 11:46:57 2016
@@ -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(DWARFContextInMemor
}
}
-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(DWARFContextInMemo
}
std::error_code dwarf2yaml(DWARFContextInMemory &DCtx,
- DWARFYAML::DWARFData &Y) {
+ DWARFYAML::Data &Y) {
dumpDebugAbbrev(DCtx, Y);
dumpDebugStrings(DCtx, Y);
Modified: llvm/trunk/tools/obj2yaml/obj2yaml.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/obj2yaml/obj2yaml.h?rev=289080&r1=289079&r2=289080&view=diff
==============================================================================
--- llvm/trunk/tools/obj2yaml/obj2yaml.h (original)
+++ llvm/trunk/tools/obj2yaml/obj2yaml.h Thu Dec 8 11:46:57 2016
@@ -28,11 +28,11 @@ std::error_code macho2yaml(llvm::raw_ost
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
Modified: llvm/trunk/tools/yaml2obj/yaml2dwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2dwarf.cpp?rev=289080&r1=289079&r2=289080&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2dwarf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2dwarf.cpp Thu Dec 8 11:46:57 2016
@@ -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);
Modified: llvm/trunk/tools/yaml2obj/yaml2obj.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2obj.h?rev=289080&r1=289079&r2=289080&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2obj.h (original)
+++ llvm/trunk/tools/yaml2obj/yaml2obj.h Thu Dec 8 11:46:57 2016
@@ -24,7 +24,7 @@ struct Object;
}
namespace DWARFYAML {
-struct DWARFData;
+struct Data;
}
namespace yaml {
@@ -38,8 +38,8 @@ int yaml2elf(llvm::ELFYAML::Object &Doc,
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
More information about the llvm-commits
mailing list