LLVM 20.0.0git
Namespaces | Functions | Variables
ELFEmitter.cpp File Reference

The ELF component of yaml2obj. More...

#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/MC/StringTableBuilder.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/ELFTypes.h"
#include "llvm/ObjectYAML/DWARFEmitter.h"
#include "llvm/ObjectYAML/DWARFYAML.h"
#include "llvm/ObjectYAML/ELFYAML.h"
#include "llvm/ObjectYAML/yaml2obj.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/LEB128.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/WithColor.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <variant>

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::yaml
 

Functions

template<class T >
static size_t arrayDataSize (ArrayRef< T > A)
 
template<class T >
static void writeArrayData (raw_ostream &OS, ArrayRef< T > A)
 
template<class T >
static void zero (T &Obj)
 
template<class ELFT >
static void overrideFields (ELFYAML::Section *From, typename ELFT::Shdr &To)
 
static uint64_t writeContent (ContiguousBlobAccumulator &CBA, const std::optional< yaml::BinaryRef > &Content, const std::optional< llvm::yaml::Hex64 > &Size)
 
static StringRef getDefaultLinkSec (unsigned SecType)
 
static size_t findFirstNonGlobal (ArrayRef< ELFYAML::Symbol > Symbols)
 
static bool shouldEmitDWARF (DWARFYAML::Data &DWARF, StringRef Name)
 
template<class ELFT >
Expected< uint64_temitDWARF (typename ELFT::Shdr &SHeader, StringRef Name, const DWARFYAML::Data &DWARF, ContiguousBlobAccumulator &CBA)
 
static bool isMips64EL (const ELFYAML::Object &Obj)
 
bool llvm::yaml::yaml2elf (ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH, uint64_t MaxSize)
 

Variables

constexpr char SuffixStart = '('
 
constexpr char SuffixEnd = ')'
 

Detailed Description

The ELF component of yaml2obj.

Definition in file ELFEmitter.cpp.

Function Documentation

◆ arrayDataSize()

template<class T >
static size_t arrayDataSize ( ArrayRef< T A)
static

Definition at line 335 of file ELFEmitter.cpp.

References A.

Referenced by writeArrayData().

◆ emitDWARF()

template<class ELFT >
Expected< uint64_t > emitDWARF ( typename ELFT::Shdr SHeader,
StringRef  Name,
const DWARFYAML::Data DWARF,
ContiguousBlobAccumulator &  CBA 
)

Definition at line 1081 of file ELFEmitter.cpp.

References llvm::DWARFYAML::getDWARFEmitterByName(), Name, and OS.

◆ findFirstNonGlobal()

static size_t findFirstNonGlobal ( ArrayRef< ELFYAML::Symbol Symbols)
static

Definition at line 936 of file ELFEmitter.cpp.

References I, and llvm::ELF::STB_LOCAL.

◆ getDefaultLinkSec()

static StringRef getDefaultLinkSec ( unsigned  SecType)
static

◆ isMips64EL()

static bool isMips64EL ( const ELFYAML::Object Obj)
static

◆ overrideFields()

template<class ELFT >
static void overrideFields ( ELFYAML::Section From,
typename ELFT::Shdr To 
)
static

Definition at line 641 of file ELFEmitter.cpp.

References From.

◆ shouldEmitDWARF()

static bool shouldEmitDWARF ( DWARFYAML::Data DWARF,
StringRef  Name 
)
static

◆ writeArrayData()

template<class T >
static void writeArrayData ( raw_ostream OS,
ArrayRef< T A 
)
static

Definition at line 339 of file ELFEmitter.cpp.

References A, arrayDataSize(), OS, and llvm::raw_ostream::write().

◆ writeContent()

static uint64_t writeContent ( ContiguousBlobAccumulator &  CBA,
const std::optional< yaml::BinaryRef > &  Content,
const std::optional< llvm::yaml::Hex64 > &  Size 
)
static

Definition at line 725 of file ELFEmitter.cpp.

References Content, and Size.

◆ zero()

template<class T >
static void zero ( T Obj)
static

Definition at line 343 of file ELFEmitter.cpp.

Variable Documentation

◆ SuffixEnd

constexpr char SuffixEnd = ')'
constexpr

◆ SuffixStart

constexpr char SuffixStart = '('
constexpr