LLVM  10.0.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::MIRFormatter Class Reference

MIRFormater - Interface to format MIR operand based on target. More...

#include "llvm/CodeGen/MIRFormatter.h"

Public Types

typedef function_ref< bool(StringRef::iterator Loc, const Twine &)> ErrorCallbackType
 

Public Member Functions

 MIRFormatter ()
 
virtual ~MIRFormatter ()=default
 
virtual void printImm (raw_ostream &OS, const MachineInstr &MI, Optional< unsigned > OpIdx, int64_t Imm) const
 Implement target specific printing for machine operand immediate value, so that we can have more meaningful mnemonic than a 64-bit integer. More...
 
virtual bool parseImmMnemonic (const unsigned OpCode, const unsigned OpIdx, StringRef Src, int64_t &Imm, ErrorCallbackType ErrorCallback) const
 Implement target specific parsing of immediate mnemonics. More...
 
virtual void printCustomPseudoSourceValue (raw_ostream &OS, ModuleSlotTracker &MST, const PseudoSourceValue &PSV) const
 Implement target specific printing of target custom pseudo source value. More...
 
virtual bool parseCustomPseudoSourceValue (StringRef Src, MachineFunction &MF, PerFunctionMIParsingState &PFS, const PseudoSourceValue *&PSV, ErrorCallbackType ErrorCallback) const
 Implement target specific parsing of target custom pseudo source value. More...
 

Static Public Member Functions

static void printIRValue (raw_ostream &OS, const Value &V, ModuleSlotTracker &MST)
 Helper functions to print IR value as MIR serialization format which will be useful for target specific printer, e.g. More...
 
static bool parseIRValue (StringRef Src, MachineFunction &MF, PerFunctionMIParsingState &PFS, const Value *&V, ErrorCallbackType ErrorCallback)
 Helper functions to parse IR value from MIR serialization format which will be useful for target specific parser, e.g. More...
 

Detailed Description

MIRFormater - Interface to format MIR operand based on target.

Definition at line 26 of file MIRFormatter.h.

Member Typedef Documentation

◆ ErrorCallbackType

Definition at line 29 of file MIRFormatter.h.

Constructor & Destructor Documentation

◆ MIRFormatter()

llvm::MIRFormatter::MIRFormatter ( )
inline

Definition at line 31 of file MIRFormatter.h.

References ~MIRFormatter().

◆ ~MIRFormatter()

virtual llvm::MIRFormatter::~MIRFormatter ( )
virtualdefault

Referenced by MIRFormatter().

Member Function Documentation

◆ parseCustomPseudoSourceValue()

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

Implement target specific parsing of target custom pseudo source value.

Definition at line 60 of file MIRFormatter.h.

References llvm_unreachable, parseIRValue(), and printIRValue().

◆ parseImmMnemonic()

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

Implement target specific parsing of immediate mnemonics.

The mnemonic is dot seperated strings.

Definition at line 44 of file MIRFormatter.h.

References llvm_unreachable.

Referenced by isImplicitOperandIn().

◆ parseIRValue()

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

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.

Definition at line 3203 of file MIParser.cpp.

References llvm::lexMIToken(), and parseIRValue().

Referenced by parseCustomPseudoSourceValue().

◆ printCustomPseudoSourceValue()

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

Implement target specific printing of target custom pseudo source value.

Default implementation is not necessarily the correct MIR serialization format.

Definition at line 54 of file MIRFormatter.h.

Referenced by llvm::MachineMemOperand::print().

◆ printImm()

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

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.

Definition at line 37 of file MIRFormatter.h.

Referenced by llvm::MachineOperand::print().

◆ printIRValue()

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

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.

Definition at line 877 of file MIRPrinter.cpp.

References llvm::ModuleSlotTracker::getCurrentFunction(), llvm::ModuleSlotTracker::getLocalSlot(), llvm::Value::getName(), llvm::Value::hasName(), llvm::Value::printAsOperand(), llvm::MachineOperand::printIRSlotNumber(), and llvm::printLLVMNameWithoutPrefix().

Referenced by parseCustomPseudoSourceValue(), and llvm::MachineMemOperand::print().


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