llvm/llvm/include/llvm/ObjectYAML/COFFYAML.h

//===- COFFYAML.h - COFF 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
//
//===----------------------------------------------------------------------===//
//
// This file declares classes for handling the YAML representation of COFF.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_OBJECTYAML_COFFYAML_H
#define LLVM_OBJECTYAML_COFFYAML_H

#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Object/COFF.h"
#include "llvm/ObjectYAML/CodeViewYAMLDebugSections.h"
#include "llvm/ObjectYAML/CodeViewYAMLTypeHashing.h"
#include "llvm/ObjectYAML/CodeViewYAMLTypes.h"
#include "llvm/ObjectYAML/YAML.h"
#include <cstdint>
#include <optional>
#include <vector>

namespace llvm {

namespace COFF {

inline Characteristics operator|(Characteristics a, Characteristics b) {}

inline SectionCharacteristics operator|(SectionCharacteristics a,
                                        SectionCharacteristics b) {}

inline DLLCharacteristics operator|(DLLCharacteristics a,
                                    DLLCharacteristics b) {}

} // end namespace COFF

// The structure of the yaml files is not an exact 1:1 match to COFF. In order
// to use yaml::IO, we use these structures which are closer to the source.
COFFYAML // end namespace COFFYAML

} // end namespace llvm

LLVM_YAML_IS_SEQUENCE_VECTOR(COFFYAML::Section)
LLVM_YAML_IS_SEQUENCE_VECTOR(COFFYAML::Symbol)
LLVM_YAML_IS_SEQUENCE_VECTOR(COFFYAML::Relocation)
LLVM_YAML_IS_SEQUENCE_VECTOR(COFFYAML::SectionDataEntry)

namespace llvm {
namespace yaml {

template <>
struct ScalarEnumerationTraits<COFFYAML::WeakExternalCharacteristics> {};

template <>
struct ScalarEnumerationTraits<COFFYAML::AuxSymbolType> {};

template <>
struct ScalarEnumerationTraits<COFFYAML::COMDATType> {};

template <>
struct ScalarEnumerationTraits<COFF::MachineTypes> {};

template <>
struct ScalarEnumerationTraits<COFF::SymbolBaseType> {};

template <>
struct ScalarEnumerationTraits<COFF::SymbolStorageClass> {};

template <>
struct ScalarEnumerationTraits<COFF::SymbolComplexType> {};

template <>
struct ScalarEnumerationTraits<COFF::RelocationTypeI386> {};

template <>
struct ScalarEnumerationTraits<COFF::RelocationTypeAMD64> {};

template <>
struct ScalarEnumerationTraits<COFF::RelocationTypesARM> {};

template <>
struct ScalarEnumerationTraits<COFF::RelocationTypesARM64> {};

template <>
struct ScalarEnumerationTraits<COFF::WindowsSubsystem> {};

template <>
struct ScalarBitSetTraits<COFF::Characteristics> {};

template <>
struct ScalarBitSetTraits<COFF::SectionCharacteristics> {};

template <>
struct ScalarBitSetTraits<COFF::DLLCharacteristics> {};

template <>
struct MappingTraits<COFFYAML::Relocation> {};

template <>
struct MappingTraits<COFFYAML::PEHeader> {};

template <>
struct MappingTraits<COFF::DataDirectory> {};

template <>
struct MappingTraits<COFF::header> {};

template <> struct MappingTraits<COFF::AuxiliaryFunctionDefinition> {};

template <> struct MappingTraits<COFF::AuxiliarybfAndefSymbol> {};

template <> struct MappingTraits<COFF::AuxiliaryWeakExternal> {};

template <> struct MappingTraits<COFF::AuxiliarySectionDefinition> {};

template <> struct MappingTraits<COFF::AuxiliaryCLRToken> {};

template <> struct MappingTraits<object::coff_load_configuration32> {};

template <> struct MappingTraits<object::coff_load_configuration64> {};

template <> struct MappingTraits<object::coff_load_config_code_integrity> {};

template <>
struct MappingTraits<COFFYAML::Symbol> {};

template <> struct MappingTraits<COFFYAML::SectionDataEntry> {};

template <>
struct MappingTraits<COFFYAML::Section> {};

template <>
struct MappingTraits<COFFYAML::Object> {};

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

#endif // LLVM_OBJECTYAML_COFFYAML_H