LLVM 20.0.0git
Classes | Namespaces | Macros | Functions
MachOBuilder.h File Reference
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MathExtras.h"
#include <list>
#include <map>
#include <vector>
#include "llvm/BinaryFormat/MachO.def"

Go to the source code of this file.

Classes

struct  llvm::orc::MachOBuilderLoadCommandBase
 Base type for MachOBuilder load command wrappers. More...
 
struct  llvm::orc::MachOBuilderLoadCommand< LCType >
 
struct  llvm::orc::MachOBuilderLoadCommand< MachO::LC_ID_DYLIB >
 
struct  llvm::orc::MachOBuilderLoadCommand< MachO::LC_LOAD_DYLIB >
 
struct  llvm::orc::MachOBuilderLoadCommand< MachO::LC_RPATH >
 
class  llvm::orc::MachOBuilder< MachOTraits >
 
class  llvm::orc::MachOBuilder< MachOTraits >::RelocTarget
 
struct  llvm::orc::MachOBuilder< MachOTraits >::Reloc
 
struct  llvm::orc::MachOBuilder< MachOTraits >::SectionContent
 
struct  llvm::orc::MachOBuilder< MachOTraits >::Section
 
struct  llvm::orc::MachOBuilder< MachOTraits >::Segment
 
struct  llvm::orc::MachO64LE
 

Namespaces

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

Macros

#define HANDLE_LOAD_COMMAND(Name, Value, LCStruct)
 

Functions

template<typename MachOStruct >
size_t llvm::orc::writeMachOStruct (MutableArrayRef< char > Buf, size_t Offset, MachOStruct S, bool SwapStruct)
 

Macro Definition Documentation

◆ HANDLE_LOAD_COMMAND

#define HANDLE_LOAD_COMMAND (   Name,
  Value,
  LCStruct 
)
Value:
template <> \
struct MachOBuilderLoadCommandImplBase<MachO::Name> \
: public MachO::LCStruct, public MachOBuilderLoadCommandBase { \
using CmdStruct = LCStruct; \
MachOBuilderLoadCommandImplBase() { \
memset(&rawStruct(), 0, sizeof(CmdStruct)); \
cmd = Value; \
cmdsize = sizeof(CmdStruct); \
} \
template <typename... ArgTs> \
MachOBuilderLoadCommandImplBase(ArgTs &&...Args) \
: CmdStruct{Value, sizeof(CmdStruct), std::forward<ArgTs>(Args)...} {} \
CmdStruct &rawStruct() { return static_cast<CmdStruct &>(*this); } \
size_t size() const override { return cmdsize; } \
size_t write(MutableArrayRef<char> Buf, size_t Offset, \
bool SwapStruct) override { \
return writeMachOStruct(Buf, Offset, rawStruct(), SwapStruct); \
} \
};
std::string Name
uint64_t Offset
Definition: ELF_riscv.cpp:478
static void write(bool isBE, void *P, T V)
size_t writeMachOStruct(MutableArrayRef< char > Buf, size_t Offset, MachOStruct S, bool SwapStruct)
Definition: MachOBuilder.h:28
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition: STLExtras.h:1697

Definition at line 48 of file MachOBuilder.h.