LLVM 20.0.0git
|
The COFF component of yaml2obj. More...
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/DebugInfo/CodeView/StringsAndChecksums.h"
#include "llvm/ObjectYAML/ObjectYAML.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/BinaryStreamWriter.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <vector>
Go to the source code of this file.
Classes | |
struct | binary_le_impl< value_type > |
struct | zeros_impl< NumBytes > |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
namespace | llvm::yaml |
Functions | |
static bool | layoutOptionalHeader (COFFParser &CP) |
static yaml::BinaryRef | toDebugS (ArrayRef< CodeViewYAML::YAMLDebugSubsection > Subsections, const codeview::StringsAndChecksums &SC, BumpPtrAllocator &Allocator) |
static bool | layoutCOFF (COFFParser &CP) |
template<typename value_type > | |
raw_ostream & | operator<< (raw_ostream &OS, const binary_le_impl< value_type > &BLE) |
template<typename value_type > | |
binary_le_impl< value_type > | binary_le (value_type V) |
template<size_t NumBytes> | |
raw_ostream & | operator<< (raw_ostream &OS, const zeros_impl< NumBytes > &) |
template<typename T > | |
zeros_impl< sizeof(T)> | zeros (const T &) |
template<typename T > | |
static uint32_t | initializeOptionalHeader (COFFParser &CP, uint16_t Magic, T Header) |
static bool | writeCOFF (COFFParser &CP, raw_ostream &OS) |
template<typename T > | |
static void | writeLoadConfig (T &S, raw_ostream &OS) |
bool | llvm::yaml::yaml2coff (COFFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH) |
The COFF component of yaml2obj.
Definition in file COFFEmitter.cpp.
binary_le_impl< value_type > binary_le | ( | value_type | V | ) |
Definition at line 318 of file COFFEmitter.cpp.
Referenced by llvm::COFFYAML::SectionDataEntry::writeAsBinary(), and writeCOFF().
|
static |
Definition at line 337 of file COFFEmitter.cpp.
References llvm::alignTo(), llvm::COFF::section::Characteristics, llvm::COFFYAML::Section::Header, llvm::COFF::IMAGE_SCN_CNT_CODE, llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA, llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA, llvm::COFFYAML::Section::Name, llvm::COFF::section::SizeOfRawData, llvm::COFF::section::VirtualAddress, and llvm::COFF::section::VirtualSize.
Referenced by writeCOFF().
|
static |
Definition at line 190 of file COFFEmitter.cpp.
References llvm::alignTo(), assert(), llvm::yaml::BinaryRef::binary_size(), llvm::COFF::section::Characteristics, llvm::COFFYAML::Section::DebugH, llvm::COFFYAML::Section::DebugP, llvm::COFFYAML::Section::DebugS, llvm::COFFYAML::Section::DebugT, llvm::COFFYAML::Section::Header, llvm::COFF::IMAGE_SCN_LNK_NRELOC_OVFL, llvm::CodeViewYAML::initializeStringsAndChecksums(), llvm::COFFYAML::Section::Name, llvm::COFF::section::NumberOfRelocations, llvm::COFF::PEMagic, llvm::COFF::section::PointerToRawData, llvm::COFF::section::PointerToRelocations, llvm::COFFYAML::Section::Relocations, llvm::COFF::RelocationSize, llvm::COFFYAML::Section::SectionData, llvm::COFF::SectionSize, llvm::ArrayRef< T >::size(), llvm::COFF::section::SizeOfRawData, llvm::COFFYAML::Section::StructuredData, llvm::CodeViewYAML::toDebugH(), toDebugS(), and llvm::CodeViewYAML::toDebugT().
Referenced by llvm::yaml::yaml2coff().
|
static |
Definition at line 151 of file COFFEmitter.cpp.
Referenced by llvm::yaml::yaml2coff().
raw_ostream & operator<< | ( | raw_ostream & | OS, |
const binary_le_impl< value_type > & | BLE | ||
) |
Definition at line 308 of file COFFEmitter.cpp.
References OS, binary_le_impl< value_type >::Value, and llvm::raw_ostream::write().
raw_ostream & operator<< | ( | raw_ostream & | OS, |
const zeros_impl< NumBytes > & | |||
) |
Definition at line 325 of file COFFEmitter.cpp.
References OS, and llvm::raw_ostream::write().
|
static |
Definition at line 163 of file COFFEmitter.cpp.
References Allocator, B, llvm::COFF::DEBUG_SECTION_MAGIC, llvm::little, Size, llvm::CodeViewYAML::toCodeViewSubsectionList(), and llvm::BinaryStreamWriter::writeInteger().
Referenced by layoutCOFF().
|
static |
Definition at line 391 of file COFFEmitter.cpp.
References llvm::object::dos_header::AddressOfNewExeHeader, llvm::object::dos_header::AddressOfRelocationTable, assert(), llvm::object::pe32_header::BaseOfData, llvm::COFF::BigObjMagic, binary_le(), llvm::yaml::BinaryRef::binary_size(), llvm::COFF::section::Characteristics, llvm::WithColor::error(), llvm::COFFYAML::Section::Header, I, llvm::COFF::IMAGE_FILE_MACHINE_UNKNOWN, llvm::COFF::IMAGE_SCN_LNK_NRELOC_OVFL, initializeOptionalHeader(), llvm::object::dos_header::Magic, llvm::COFF::BigObjHeader::MinBigObjectVersion, llvm::COFF::section::Name, llvm::COFF::NameSize, llvm::COFF::section::NumberOfLineNumbers, llvm::COFF::section::NumberOfRelocations, OS, llvm::COFF::PE32Header::PE32, llvm::COFF::PE32Header::PE32_PLUS, llvm::COFF::PEMagic, llvm::COFF::section::PointerToLineNumbers, llvm::COFF::section::PointerToRawData, llvm::COFF::section::PointerToRelocations, llvm::COFFYAML::Section::Relocations, llvm::COFFYAML::Section::SectionData, Size, llvm::COFF::section::SizeOfRawData, llvm::COFFYAML::Section::StructuredData, Sym, llvm::COFF::Symbol16Size, llvm::raw_ostream::tell(), llvm::COFF::section::VirtualAddress, llvm::COFF::section::VirtualSize, llvm::raw_ostream::write(), llvm::raw_ostream::write_zeros(), llvm::yaml::BinaryRef::writeAsBinary(), and zeros().
Referenced by llvm::yaml::yaml2coff().
|
static |
Definition at line 598 of file COFFEmitter.cpp.
References OS, llvm::raw_ostream::write(), and llvm::raw_ostream::write_zeros().
Referenced by llvm::COFFYAML::SectionDataEntry::writeAsBinary().
zeros_impl< sizeof(T)> zeros | ( | const T & | ) |
Definition at line 332 of file COFFEmitter.cpp.
Referenced by writeCOFF().