llvm/llvm/include/llvm/Object/COFF.h

//===- COFF.h - COFF object file 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 the COFFObjectFile class.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_OBJECT_COFF_H
#define LLVM_OBJECT_COFF_H

#include "llvm/ADT/iterator_range.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/Object/Binary.h"
#include "llvm/Object/CVDebugRecord.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/BinaryByteStream.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/TargetParser/SubtargetFeature.h"
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <system_error>

namespace llvm {

template <typename T> class ArrayRef;

namespace object {

class Arm64XRelocRef;
class BaseRelocRef;
class DelayImportDirectoryEntryRef;
class DynamicRelocRef;
class ExportDirectoryEntryRef;
class ImportDirectoryEntryRef;
class ImportedSymbolRef;
class ResourceSectionRef;

import_directory_iterator;
delay_import_directory_iterator;
export_directory_iterator;
imported_symbol_iterator;
base_reloc_iterator;
dynamic_reloc_iterator;
arm64x_reloc_iterator;

/// The DOS compatible header at the front of all PE/COFF executables.
struct dos_header {};

struct coff_file_header {};

struct coff_bigobj_file_header {};

/// The 32-bit PE header that follows the COFF header.
struct pe32_header {};

/// The 64-bit PE header that follows the COFF header.
struct pe32plus_header {};

struct data_directory {};

struct debug_directory {};

template <typename IntTy>
struct import_lookup_table_entry {};

import_lookup_table_entry32;
import_lookup_table_entry64;

struct delay_import_directory_table_entry {};

struct export_directory_table_entry {};

export_address_table_entry;

export_name_pointer_table_entry;
export_ordinal_table_entry;

struct StringTableOffset {};

template <typename SectionNumberType>
struct coff_symbol {};

coff_symbol16;
coff_symbol32;

// Contains only common parts of coff_symbol16 and coff_symbol32.
struct coff_symbol_generic {};

struct coff_aux_section_definition;
struct coff_aux_weak_external;

class COFFSymbolRef {};

struct coff_section {};

struct coff_relocation {};

struct coff_aux_function_definition {};

static_assert;

struct coff_aux_bf_and_ef_symbol {};

static_assert;

struct coff_aux_weak_external {};

static_assert;

struct coff_aux_section_definition {};

static_assert;

struct coff_aux_clr_token {};

static_assert;

struct coff_import_header {};

struct coff_import_directory_table_entry {};

template <typename IntTy>
struct coff_tls_directory {};

coff_tls_directory32;
coff_tls_directory64;

enum class frame_type : uint16_t {};

struct coff_load_config_code_integrity {};

/// 32-bit load config (IMAGE_LOAD_CONFIG_DIRECTORY32)
struct coff_load_configuration32 {};

/// 64-bit load config (IMAGE_LOAD_CONFIG_DIRECTORY64)
struct coff_load_configuration64 {};

struct chpe_metadata {};

enum chpe_range_type {};

struct chpe_range_entry {};

struct chpe_code_range_entry {};

struct chpe_redirection_entry {};

struct coff_runtime_function_x64 {};

struct coff_base_reloc_block_header {};

struct coff_base_reloc_block_entry {};

struct coff_resource_dir_entry {};

struct coff_resource_data_entry {};

struct coff_resource_dir_table {};

struct debug_h_header {};

struct coff_dynamic_reloc_table {};

struct coff_dynamic_relocation32 {};

struct coff_dynamic_relocation64 {};

struct coff_dynamic_relocation32_v2 {};

struct coff_dynamic_relocation64_v2 {};

class COFFObjectFile : public ObjectFile {};

// The iterator for the import directory table.
class ImportDirectoryEntryRef {};

class DelayImportDirectoryEntryRef {};

// The iterator for the export directory table entry.
class ExportDirectoryEntryRef {};

class ImportedSymbolRef {};

class BaseRelocRef {};

class DynamicRelocRef {};

class Arm64XRelocRef {};

class ResourceSectionRef {};

// Corresponds to `_FPO_DATA` structure in the PE/COFF spec.
struct FpoData {};

class SectionStrippedError
    : public ErrorInfo<SectionStrippedError, BinaryError> {};

} // end namespace object

} // end namespace llvm

#endif // LLVM_OBJECT_COFF_H