llvm.org GIT mirror llvm / 4d6c7e9
[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 Chris Bieneman 2 years ago
7 changed file(s) with 36 addition(s) and 36 deletion(s). Raw diff Collapse all Expand all
2222 namespace llvm {
2323 namespace DWARFYAML {
2424
25 struct DWARFAttributeAbbrev {
25 struct AttributeAbbrev {
2626 llvm::dwarf::Attribute Attribute;
2727 llvm::dwarf::Form Form;
2828 };
2929
30 struct DWARFAbbrev {
30 struct Abbrev {
3131 llvm::yaml::Hex32 Code;
3232 llvm::dwarf::Tag Tag;
3333 llvm::dwarf::Constants Children;
34 std::vector<DWARFAttributeAbbrev> Attributes;
34 std::vector<AttributeAbbrev> Attributes;
3535 };
3636
37 struct DWARFData {
38 std::vector AbbrevDecls;
37 struct Data {
38 std::vector AbbrevDecls;
3939 std::vector DebugStrings;
4040
4141 bool isEmpty() const;
42 };
42 };
4343
4444 } // namespace llvm::DWARFYAML
4545 } // namespace llvm
4646
4747 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::StringRef)
48 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DWARFAttributeAbbrev)
49 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DWARFAbbrev)
48 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AttributeAbbrev)
49 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Abbrev)
5050
5151 namespace llvm {
5252 namespace yaml {
5353
54 template <> struct MappingTraits {
55 static void mapping(IO &IO, DWARFYAML::DWARFData &DWARF);
54 template <> struct MappingTraits {
55 static void mapping(IO &IO, DWARFYAML::Data &DWARF);
5656 };
5757
58 template <> struct MappingTraits {
59 static void mapping(IO &IO, DWARFYAML::DWARFAbbrev &Abbrev);
58 template <> struct MappingTraits {
59 static void mapping(IO &IO, DWARFYAML::Abbrev &Abbrev);
6060 };
6161
62 template <> struct MappingTraits {
63 static void mapping(IO &IO, DWARFYAML::DWARFAttributeAbbrev &AttAbbrev);
62 template <> struct MappingTraits {
63 static void mapping(IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev);
6464 };
6565
66 #define HANDLE_DW_TAG(unused, name) \
66 #define HANDLE_DW_TAG(unused, name) \
6767 io.enumCase(value, "DW_TAG_" #name, dwarf::DW_TAG_##name);
6868
6969 template <> struct ScalarEnumerationTraits {
8383 }
8484 };
8585
86 #define HANDLE_DW_FORM(unused, name) \
86 #define HANDLE_DW_FORM(unused, name) \
8787 io.enumCase(value, "DW_FORM_" #name, dwarf::DW_FORM_##name);
8888
8989 template <> struct ScalarEnumerationTraits {
109109 std::vector LoadCommands;
110110 std::vector
Sections;
111111 LinkEditData LinkEdit;
112 DWARFYAML::DWARFData DWARF;
112 DWARFYAML::Data DWARF;
113113 };
114114
115115 struct FatHeader {
1515
1616 namespace llvm {
1717
18 bool DWARFYAML::DWARFData::isEmpty() const {
18 bool DWARFYAML::Data::isEmpty() const {
1919 return 0 == DebugStrings.size() + AbbrevDecls.size();
2020 }
2121
2222 namespace yaml {
2323
24 void MappingTraits::mapping(
25 IO &IO, DWARFYAML::DWARFData &DWARF) {
24 void MappingTraits::mapping(
25 IO &IO, DWARFYAML::Data &DWARF) {
2626 IO.mapOptional("debug_str", DWARF.DebugStrings);
2727 IO.mapOptional("debug_abbrev", DWARF.AbbrevDecls);
2828 }
2929
30 void MappingTraits::mapping(
31 IO &IO, DWARFYAML::DWARFAbbrev &Abbrev) {
30 void MappingTraits::mapping(
31 IO &IO, DWARFYAML::Abbrev &Abbrev) {
3232 IO.mapRequired("Code", Abbrev.Code);
3333 IO.mapRequired("Tag", Abbrev.Tag);
3434 IO.mapRequired("Children", Abbrev.Children);
3535 IO.mapRequired("Attributes", Abbrev.Attributes);
3636 }
3737
38 void MappingTraits::mapping(
39 IO &IO, DWARFYAML::DWARFAttributeAbbrev &AttAbbrev) {
38 void MappingTraits::mapping(
39 IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev) {
4040 IO.mapRequired("Attribute", AttAbbrev.Attribute);
4141 IO.mapRequired("Form", AttAbbrev.Form);
4242 }
1212
1313 using namespace llvm;
1414
15 void dumpDebugAbbrev(DWARFContextInMemory &DCtx, DWARFYAML::DWARFData &Y) {
15 void dumpDebugAbbrev(DWARFContextInMemory &DCtx, DWARFYAML::Data &Y) {
1616 auto AbbrevSetPtr = DCtx.getDebugAbbrev();
1717 if (AbbrevSetPtr) {
1818 for (auto AbbrvDeclSet : *AbbrevSetPtr) {
1919 for (auto AbbrvDecl : AbbrvDeclSet.second) {
20 DWARFYAML::DWARFAbbrev Abbrv;
20 DWARFYAML::Abbrev Abbrv;
2121 Abbrv.Code = AbbrvDecl.getCode();
2222 Abbrv.Tag = AbbrvDecl.getTag();
2323 Abbrv.Children = AbbrvDecl.hasChildren() ? dwarf::DW_CHILDREN_yes
2424 : dwarf::DW_CHILDREN_no;
2525 for (auto Attribute : AbbrvDecl.attributes()) {
26 DWARFYAML::DWARFAttributeAbbrev AttAbrv;
26 DWARFYAML::AttributeAbbrev AttAbrv;
2727 AttAbrv.Attribute = Attribute.Attr;
2828 AttAbrv.Form = Attribute.Form;
2929 Abbrv.Attributes.push_back(AttAbrv);
3434 }
3535 }
3636
37 void dumpDebugStrings(DWARFContextInMemory &DCtx, DWARFYAML::DWARFData &Y) {
37 void dumpDebugStrings(DWARFContextInMemory &DCtx, DWARFYAML::Data &Y) {
3838 StringRef RemainingTable = DCtx.getStringSection();
3939 while (RemainingTable.size() > 0) {
4040 auto SymbolPair = RemainingTable.split('\0');
4444 }
4545
4646 std::error_code dwarf2yaml(DWARFContextInMemory &DCtx,
47 DWARFYAML::DWARFData &Y) {
47 DWARFYAML::Data &Y) {
4848 dumpDebugAbbrev(DCtx, Y);
4949 dumpDebugStrings(DCtx, Y);
5050
2727 namespace llvm {
2828 class DWARFContextInMemory;
2929 namespace DWARFYAML {
30 struct DWARFData;
30 struct Data;
3131 }
3232 }
3333
3434 std::error_code dwarf2yaml(llvm::DWARFContextInMemory &DCtx,
35 llvm::DWARFYAML::DWARFData &Y);
35 llvm::DWARFYAML::Data &Y);
3636
3737 #endif
1818
1919 using namespace llvm;
2020
21 void yaml2debug_str(raw_ostream &OS, const DWARFYAML::DWARFData &DI) {
21 void yaml2debug_str(raw_ostream &OS, const DWARFYAML::Data &DI) {
2222 for (auto Str : DI.DebugStrings) {
2323 OS.write(Str.data(), Str.size());
2424 OS.write('\0');
2525 }
2626 }
2727
28 void yaml2debug_abbrev(raw_ostream &OS, const DWARFYAML::DWARFData &DI) {
28 void yaml2debug_abbrev(raw_ostream &OS, const DWARFYAML::Data &DI) {
2929 for (auto AbbrevDecl : DI.AbbrevDecls) {
3030 encodeULEB128(AbbrevDecl.Code, OS);
3131 encodeULEB128(AbbrevDecl.Tag, OS);
2323 }
2424
2525 namespace DWARFYAML {
26 struct DWARFData;
26 struct Data;
2727 }
2828
2929 namespace yaml {
3737 int yaml2macho(llvm::yaml::YamlObjectFile &Doc, llvm::raw_ostream &Out);
3838
3939 void yaml2debug_abbrev(llvm::raw_ostream &OS,
40 const llvm::DWARFYAML::DWARFData &DI);
40 const llvm::DWARFYAML::Data &DI);
4141 void yaml2debug_str(llvm::raw_ostream &OS,
42 const llvm::DWARFYAML::DWARFData &DI);
42 const llvm::DWARFYAML::Data &DI);
4343
4444 #endif