llvm/llvm/include/llvm/ObjectYAML/DWARFYAML.h

//===- DWARFYAML.h - DWARF YAMLIO implementation ----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file declares classes for handling the YAML representation
/// of DWARF Debug Info.
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_OBJECTYAML_DWARFYAML_H
#define LLVM_OBJECTYAML_DWARFYAML_H

#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/ObjectYAML/YAML.h"
#include "llvm/Support/YAMLTraits.h"
#include <cstdint>
#include <optional>
#include <unordered_map>
#include <vector>

namespace llvm {
namespace DWARFYAML {

struct AttributeAbbrev {};

struct Abbrev {};

struct AbbrevTable {};

struct ARangeDescriptor {};

struct ARange {};

/// Class that describes a range list entry, or a base address selection entry
/// within a range list in the .debug_ranges section.
struct RangeEntry {};

/// Class that describes a single range list inside the .debug_ranges section.
struct Ranges {};

struct PubEntry {};

struct PubSection {};

struct FormValue {};

struct Entry {};

/// Class that contains helpful context information when mapping YAML into DWARF
/// data structures.
struct DWARFContext {};

struct Unit {};

struct IdxForm {};

struct DebugNameAbbreviation {};

struct DebugNameEntry {};

struct DebugNamesSection {};

struct File {};

struct LineTableOpcode {};

struct LineTable {};

struct SegAddrPair {};

struct AddrTableEntry {};

struct StringOffsetsTable {};

struct DWARFOperation {};

struct RnglistEntry {};

struct LoclistEntry {};

template <typename EntryType> struct ListEntries {};

template <typename EntryType> struct ListTable {};

struct Data {};

} // end namespace DWARFYAML
} // end namespace llvm

LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AttributeAbbrev)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Abbrev)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AbbrevTable)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::ARangeDescriptor)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::ARange)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::RangeEntry)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Ranges)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::PubEntry)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Unit)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::FormValue)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Entry)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::File)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::LineTable)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::LineTableOpcode)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::SegAddrPair)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AddrTableEntry)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::StringOffsetsTable)
LLVM_YAML_IS_SEQUENCE_VECTOR(
    llvm::DWARFYAML::ListTable<DWARFYAML::RnglistEntry>)
LLVM_YAML_IS_SEQUENCE_VECTOR(
    llvm::DWARFYAML::ListEntries<DWARFYAML::RnglistEntry>)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::RnglistEntry)
LLVM_YAML_IS_SEQUENCE_VECTOR(
    llvm::DWARFYAML::ListTable<DWARFYAML::LoclistEntry>)
LLVM_YAML_IS_SEQUENCE_VECTOR(
    llvm::DWARFYAML::ListEntries<DWARFYAML::LoclistEntry>)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::LoclistEntry)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DWARFOperation)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DebugNameEntry)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::DebugNameAbbreviation)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::IdxForm)

namespace llvm {
namespace yaml {

template <> struct MappingTraits<DWARFYAML::Data> {};

template <> struct MappingTraits<DWARFYAML::AbbrevTable> {};

template <> struct MappingTraits<DWARFYAML::Abbrev> {};

template <> struct MappingTraits<DWARFYAML::AttributeAbbrev> {};

template <> struct MappingTraits<DWARFYAML::ARangeDescriptor> {};

template <> struct MappingTraits<DWARFYAML::ARange> {};

template <> struct MappingTraits<DWARFYAML::RangeEntry> {};

template <> struct MappingTraits<DWARFYAML::Ranges> {};

template <> struct MappingTraits<DWARFYAML::PubEntry> {};

template <> struct MappingTraits<DWARFYAML::PubSection> {};

template <> struct MappingTraits<DWARFYAML::Unit> {};

template <> struct MappingTraits<DWARFYAML::DebugNamesSection> {};
template <> struct MappingTraits<DWARFYAML::DebugNameEntry> {};
template <> struct MappingTraits<DWARFYAML::DebugNameAbbreviation> {};
template <> struct MappingTraits<DWARFYAML::IdxForm> {};

template <> struct MappingTraits<DWARFYAML::Entry> {};

template <> struct MappingTraits<DWARFYAML::FormValue> {};

template <> struct MappingTraits<DWARFYAML::File> {};

template <> struct MappingTraits<DWARFYAML::LineTableOpcode> {};

template <> struct MappingTraits<DWARFYAML::LineTable> {};

template <> struct MappingTraits<DWARFYAML::SegAddrPair> {};

template <> struct MappingTraits<DWARFYAML::DWARFOperation> {};

MappingTraits<DWARFYAML::ListTable<EntryType>>;

MappingTraits<DWARFYAML::ListEntries<EntryType>>;

template <> struct MappingTraits<DWARFYAML::RnglistEntry> {};

template <> struct MappingTraits<DWARFYAML::LoclistEntry> {};

template <> struct MappingTraits<DWARFYAML::AddrTableEntry> {};

template <> struct MappingTraits<DWARFYAML::StringOffsetsTable> {};

template <> struct ScalarEnumerationTraits<dwarf::DwarfFormat> {};

#define HANDLE_DW_TAG

template <> struct ScalarEnumerationTraits<dwarf::Tag> {};

#define HANDLE_DW_LNS

template <> struct ScalarEnumerationTraits<dwarf::LineNumberOps> {};

#define HANDLE_DW_LNE

template <> struct ScalarEnumerationTraits<dwarf::LineNumberExtendedOps> {};

#define HANDLE_DW_AT

template <> struct ScalarEnumerationTraits<dwarf::Attribute> {};

#define HANDLE_DW_FORM

template <> struct ScalarEnumerationTraits<dwarf::Form> {};

#define HANDLE_DW_IDX

template <> struct ScalarEnumerationTraits<dwarf::Index> {};

#define HANDLE_DW_UT

template <> struct ScalarEnumerationTraits<dwarf::UnitType> {};

template <> struct ScalarEnumerationTraits<dwarf::Constants> {};

#define HANDLE_DW_RLE

template <> struct ScalarEnumerationTraits<dwarf::RnglistEntries> {};

#define HANDLE_DW_LLE

template <> struct ScalarEnumerationTraits<dwarf::LoclistEntries> {};

#define HANDLE_DW_OP

template <> struct ScalarEnumerationTraits<dwarf::LocationAtom> {};

} // end namespace yaml
} // end namespace llvm

#endif // LLVM_OBJECTYAML_DWARFYAML_H