class MIRFormatter

Declaration

class MIRFormatter { /* full declaration omitted */ };

Description

MIRFormater - Interface to format MIR operand based on target

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:28

Method Overview

  • public MIRFormatter()
  • public virtual bool parseCustomPseudoSourceValue(llvm::StringRef Src, llvm::MachineFunction & MF, llvm::PerFunctionMIParsingState & PFS, const llvm::PseudoSourceValue *& PSV, llvm::MIRFormatter::ErrorCallbackType ErrorCallback) const
  • public static bool parseIRValue(llvm::StringRef Src, llvm::MachineFunction & MF, llvm::PerFunctionMIParsingState & PFS, const llvm::Value *& V, llvm::MIRFormatter::ErrorCallbackType ErrorCallback)
  • public virtual bool parseImmMnemonic(const unsigned int OpCode, const unsigned int OpIdx, llvm::StringRef Src, int64_t & Imm, llvm::MIRFormatter::ErrorCallbackType ErrorCallback) const
  • public virtual void printCustomPseudoSourceValue(llvm::raw_ostream & OS, llvm::ModuleSlotTracker & MST, const llvm::PseudoSourceValue & PSV) const
  • public static void printIRValue(llvm::raw_ostream & OS, const llvm::Value & V, llvm::ModuleSlotTracker & MST)
  • public virtual void printImm(llvm::raw_ostream & OS, const llvm::MachineInstr & MI, Optional<unsigned int> OpIdx, int64_t Imm) const
  • public virtual ~MIRFormatter()

Methods

MIRFormatter()

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:33

virtual bool parseCustomPseudoSourceValue(
    llvm::StringRef Src,
    llvm::MachineFunction& MF,
    llvm::PerFunctionMIParsingState& PFS,
    const llvm::PseudoSourceValue*& PSV,
    llvm::MIRFormatter::ErrorCallbackType
        ErrorCallback) const

Description

Implement target specific parsing of target custom pseudo source value.

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:62

Parameters

llvm::StringRef Src
llvm::MachineFunction& MF
llvm::PerFunctionMIParsingState& PFS
const llvm::PseudoSourceValue*& PSV
llvm::MIRFormatter::ErrorCallbackType ErrorCallback

static bool parseIRValue(
    llvm::StringRef Src,
    llvm::MachineFunction& MF,
    llvm::PerFunctionMIParsingState& PFS,
    const llvm::Value*& V,
    llvm::MIRFormatter::ErrorCallbackType
        ErrorCallback)

Description

Helper functions to parse IR value from MIR serialization format which will be useful for target specific parser, e.g. for parsing IR value for custom pseudo source value.

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:78

Parameters

llvm::StringRef Src
llvm::MachineFunction& MF
llvm::PerFunctionMIParsingState& PFS
const llvm::Value*& V
llvm::MIRFormatter::ErrorCallbackType ErrorCallback

virtual bool parseImmMnemonic(
    const unsigned int OpCode,
    const unsigned int OpIdx,
    llvm::StringRef Src,
    int64_t& Imm,
    llvm::MIRFormatter::ErrorCallbackType
        ErrorCallback) const

Description

Implement target specific parsing of immediate mnemonics. The mnemonic is dot seperated strings.

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:46

Parameters

const unsigned int OpCode
const unsigned int OpIdx
llvm::StringRef Src
int64_t& Imm
llvm::MIRFormatter::ErrorCallbackType ErrorCallback

virtual void printCustomPseudoSourceValue(
    llvm::raw_ostream& OS,
    llvm::ModuleSlotTracker& MST,
    const llvm::PseudoSourceValue& PSV) const

Description

Implement target specific printing of target custom pseudo source value. Default implementation is not necessarily the correct MIR serialization format.

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:56

Parameters

llvm::raw_ostream& OS
llvm::ModuleSlotTracker& MST
const llvm::PseudoSourceValue& PSV

static void printIRValue(
    llvm::raw_ostream& OS,
    const llvm::Value& V,
    llvm::ModuleSlotTracker& MST)

Description

Helper functions to print IR value as MIR serialization format which will be useful for target specific printer, e.g. for printing IR value in custom pseudo source value.

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:72

Parameters

llvm::raw_ostream& OS
const llvm::Value& V
llvm::ModuleSlotTracker& MST

virtual void printImm(
    llvm::raw_ostream& OS,
    const llvm::MachineInstr& MI,
    Optional<unsigned int> OpIdx,
    int64_t Imm) const

Description

Implement target specific printing for machine operand immediate value, so that we can have more meaningful mnemonic than a 64-bit integer. Passing None to OpIdx means the index is unknown.

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:39

Parameters

llvm::raw_ostream& OS
const llvm::MachineInstr& MI
Optional<unsigned int> OpIdx
int64_t Imm

virtual ~MIRFormatter()

Declared at: llvm/include/llvm/CodeGen/MIRFormatter.h:34