LLVM 17.0.0git
Public Member Functions | Protected Member Functions | List of all members
llvm::MCCodeEmitter Class Reference

MCCodeEmitter - Generic instruction encoding interface. More...

#include "llvm/MC/MCCodeEmitter.h"

Inheritance diagram for llvm::MCCodeEmitter:
Inheritance graph
[legend]

Public Member Functions

 MCCodeEmitter (const MCCodeEmitter &)=delete
 
MCCodeEmitteroperator= (const MCCodeEmitter &)=delete
 
virtual ~MCCodeEmitter ()
 
virtual void reset ()
 Lifetime management.
 
virtual void emitPrefix (const MCInst &Inst, SmallVectorImpl< char > &CB, const MCSubtargetInfo &STI) const
 Append the prefixes of given instruction to the code buffer.
 
virtual void encodeInstruction (const MCInst &Inst, SmallVectorImpl< char > &CB, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 EncodeInstruction - Encode the given Inst to bytes and append to CB.
 

Protected Member Functions

 MCCodeEmitter ()
 
virtual void encodeInstruction (const MCInst &Inst, raw_ostream &OS, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 EncodeInstruction - Encode the given Inst to bytes on the output stream OS.
 

Detailed Description

MCCodeEmitter - Generic instruction encoding interface.

Definition at line 21 of file MCCodeEmitter.h.

Constructor & Destructor Documentation

◆ MCCodeEmitter() [1/2]

MCCodeEmitter::MCCodeEmitter ( )
protecteddefault

◆ MCCodeEmitter() [2/2]

llvm::MCCodeEmitter::MCCodeEmitter ( const MCCodeEmitter )
delete

◆ ~MCCodeEmitter()

MCCodeEmitter::~MCCodeEmitter ( )
virtualdefault

Member Function Documentation

◆ emitPrefix()

virtual void llvm::MCCodeEmitter::emitPrefix ( const MCInst Inst,
SmallVectorImpl< char > &  CB,
const MCSubtargetInfo STI 
) const
inlinevirtual

Append the prefixes of given instruction to the code buffer.

Parameters
Insta single low-level machine instruction.
CBcode buffer

Definition at line 44 of file MCCodeEmitter.h.

◆ encodeInstruction() [1/2]

virtual void llvm::MCCodeEmitter::encodeInstruction ( const MCInst Inst,
raw_ostream OS,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const
inlineprotectedvirtual

EncodeInstruction - Encode the given Inst to bytes on the output stream OS.

Allows for an implementation of encodeInstruction that uses streams instead of a SmallVector.

Reimplemented in llvm::CSKYMCCodeEmitter, llvm::MipsMCCodeEmitter, llvm::MSP430MCCodeEmitter, llvm::PPCMCCodeEmitter, and llvm::HexagonMCCodeEmitter.

Definition at line 28 of file MCCodeEmitter.h.

Referenced by llvm::AMDGPUAsmPrinter::emitInstruction(), llvm::MCXCOFFStreamer::emitInstToData(), llvm::MCWinCOFFStreamer::emitInstToData(), llvm::MCObjectStreamer::emitInstToFragment(), and encodeInstruction().

◆ encodeInstruction() [2/2]

void MCCodeEmitter::encodeInstruction ( const MCInst Inst,
SmallVectorImpl< char > &  CB,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const
virtual

EncodeInstruction - Encode the given Inst to bytes and append to CB.

Definition at line 18 of file MCCodeEmitter.cpp.

References encodeInstruction(), and OS.

◆ operator=()

MCCodeEmitter & llvm::MCCodeEmitter::operator= ( const MCCodeEmitter )
delete

◆ reset()

virtual void llvm::MCCodeEmitter::reset ( )
inlinevirtual

Lifetime management.

Definition at line 38 of file MCCodeEmitter.h.

Referenced by llvm::MCAssembler::reset().


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