Nyxstone
Loading...
Searching...
No Matches
nyxstone::ELFStreamerWrapper Class Reference

#include <ELFStreamerWrapper.h>

Inheritance diagram for nyxstone::ELFStreamerWrapper:

Public Member Functions

 ELFStreamerWrapper (llvm::MCContext &context, std::unique_ptr< llvm::MCAsmBackend > &&assembler_backend, std::unique_ptr< llvm::MCObjectWriter > &&object_writer, std::unique_ptr< llvm::MCCodeEmitter > &&code_emitter, std::vector< Nyxstone::Instruction > *instructions, std::string &extended_error, llvm::MCInstPrinter &instruction_printer)
 ELFStreamerWrapper constructor.
 
void emitInstruction (const llvm::MCInst &Inst, const llvm::MCSubtargetInfo &STI) override
 Calls MCELFStreamer::emitInstruction and records instruction details.
 

Static Public Member Functions

static std::unique_ptr< llvm::MCStreamer > createELFStreamerWrapper (llvm::MCContext &context, std::unique_ptr< llvm::MCAsmBackend > &&assembler_backend, std::unique_ptr< llvm::MCObjectWriter > &&object_writer, std::unique_ptr< llvm::MCCodeEmitter > &&code_emitter, bool RelaxAll, std::vector< Nyxstone::Instruction > *instructions, std::string &extended_error, llvm::MCInstPrinter &instruction_printer)
 Creates a UniquePtr holding the ELFStreamerWrapper.
 

Detailed Description

This class derives from LLVM's MCELFStreamer, which enables us to receive information during assembly such as preliminary instruction size and bytes before relaxation and fixups (via method 'emitInstruction()').

Constructor & Destructor Documentation

◆ ELFStreamerWrapper()

nyxstone::ELFStreamerWrapper::ELFStreamerWrapper ( llvm::MCContext & context,
std::unique_ptr< llvm::MCAsmBackend > && assembler_backend,
std::unique_ptr< llvm::MCObjectWriter > && object_writer,
std::unique_ptr< llvm::MCCodeEmitter > && code_emitter,
std::vector< Nyxstone::Instruction > * instructions,
std::string & extended_error,
llvm::MCInstPrinter & instruction_printer )
inline

ELFStreamerWrapper constructor.

Parameters
contextThe MCContext used for reporting errors.
assembler_backendBackend for the wrapped MCELFStreamer.
object_writerWriter for the wrapped MCELFStreamer.
code_emitterEmitter for the wrapped MCELFStreamer.
RelaxAllRelax all instructions that can be relaxed.
instructionsVector to store instruction information.
extended_errorReference to nyxstone error string.
instruction_printerInstruction printer used to generate the instruction assembly.

Member Function Documentation

◆ createELFStreamerWrapper()

std::unique_ptr< MCStreamer > nyxstone::ELFStreamerWrapper::createELFStreamerWrapper ( llvm::MCContext & context,
std::unique_ptr< llvm::MCAsmBackend > && assembler_backend,
std::unique_ptr< llvm::MCObjectWriter > && object_writer,
std::unique_ptr< llvm::MCCodeEmitter > && code_emitter,
bool RelaxAll,
std::vector< Nyxstone::Instruction > * instructions,
std::string & extended_error,
llvm::MCInstPrinter & instruction_printer )
static

Creates a UniquePtr holding the ELFStreamerWrapper.

Parameters
contextThe MCContext used for reporting errors.
assembler_backendBackend for the wrapped MCELFStreamer.
object_writerWriter for the wrapped MCELFStreamer.
code_emitterEmitter for the wrapped MCELFStreamer.
RelaxAllRelax all instructions that can be relaxed.
instructionsVector to store instruction information.
extended_errorReference to nyxstone error string.
instruction_printerInstruction printer used to generate the instruction assembly.
Returns
unique_ptr holding the ELFStreamerWrapper

The documentation for this class was generated from the following files: