blob: ca04e2e268750a46ed2a5c450392e79cbf31df9b [file] [log] [blame]
Chris Bieneman79e60eb2016-12-07 21:26:32 +00001//===- DWARFYAML.cpp - DWARF YAMLIO implementation ------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines classes for handling the YAML representation of DWARF Debug
11// Info.
12//
13//===----------------------------------------------------------------------===//
14
15#include "llvm/ObjectYAML/DWARFYAML.h"
16
17namespace llvm {
18
Chris Bienemanfbf7dfe2016-12-08 17:46:57 +000019bool DWARFYAML::Data::isEmpty() const {
Chris Bieneman79e60eb2016-12-07 21:26:32 +000020 return 0 == DebugStrings.size() + AbbrevDecls.size();
21}
22
23namespace yaml {
24
Chris Bienemanfbf7dfe2016-12-08 17:46:57 +000025void MappingTraits<DWARFYAML::Data>::mapping(
26 IO &IO, DWARFYAML::Data &DWARF) {
Chris Bieneman79e60eb2016-12-07 21:26:32 +000027 IO.mapOptional("debug_str", DWARF.DebugStrings);
28 IO.mapOptional("debug_abbrev", DWARF.AbbrevDecls);
29}
30
Chris Bienemanfbf7dfe2016-12-08 17:46:57 +000031void MappingTraits<DWARFYAML::Abbrev>::mapping(
32 IO &IO, DWARFYAML::Abbrev &Abbrev) {
Chris Bieneman79e60eb2016-12-07 21:26:32 +000033 IO.mapRequired("Code", Abbrev.Code);
34 IO.mapRequired("Tag", Abbrev.Tag);
35 IO.mapRequired("Children", Abbrev.Children);
36 IO.mapRequired("Attributes", Abbrev.Attributes);
37}
38
Chris Bienemanfbf7dfe2016-12-08 17:46:57 +000039void MappingTraits<DWARFYAML::AttributeAbbrev>::mapping(
40 IO &IO, DWARFYAML::AttributeAbbrev &AttAbbrev) {
Chris Bieneman79e60eb2016-12-07 21:26:32 +000041 IO.mapRequired("Attribute", AttAbbrev.Attribute);
42 IO.mapRequired("Form", AttAbbrev.Form);
43}
44
45} // namespace llvm::yaml
46
47} // namespace llvm