class MIRParserImpl

Declaration

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

Description

This class implements the parsing of LLVM IR that's embedded inside a MIR file.

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:52

Method Overview

  • public MIRParserImpl(std::unique_ptr<MemoryBuffer> Contents, llvm::StringRef Filename, llvm::LLVMContext & Context, std::function<void (Function &)> ProcessIRFunction)
  • public llvm::Function * createDummyFunction(llvm::StringRef Name, llvm::Module & M)
  • public bool error(const llvm::Twine & Message)
  • public bool error(llvm::SMLoc Loc, const llvm::Twine & Message)
  • public bool error(const llvm::SMDiagnostic & Error, llvm::SMRange SourceRange)
  • public bool initializeCallSiteInfo(llvm::PerFunctionMIParsingState & PFS, const yaml::MachineFunction & YamlMF)
  • public bool initializeConstantPool(llvm::PerFunctionMIParsingState & PFS, llvm::MachineConstantPool & ConstantPool, const yaml::MachineFunction & YamlMF)
  • public bool initializeFrameInfo(llvm::PerFunctionMIParsingState & PFS, const yaml::MachineFunction & YamlMF)
  • public bool initializeJumpTableInfo(llvm::PerFunctionMIParsingState & PFS, const yaml::MachineJumpTable & YamlJTI)
  • public bool initializeMachineFunction(const yaml::MachineFunction & YamlMF, llvm::MachineFunction & MF)
  • public bool parseCalleeSavedRegister(llvm::PerFunctionMIParsingState & PFS, std::vector<CalleeSavedInfo> & CSIInfo, const yaml::StringValue & RegisterSource, bool IsRestored, int FrameIdx)
  • public std::unique_ptr<Module> parseIRModule()
  • public bool parseMachineFunction(llvm::Module & M, llvm::MachineModuleInfo & MMI)
  • public bool parseMachineFunctions(llvm::Module & M, llvm::MachineModuleInfo & MMI)
  • public bool parseRegisterInfo(llvm::PerFunctionMIParsingState & PFS, const yaml::MachineFunction & YamlMF)
  • public template <typename T>bool parseStackObjectsDebugInfo(llvm::PerFunctionMIParsingState & PFS, const T & Object, int FrameIdx)
  • public void reportDiagnostic(const llvm::SMDiagnostic & Diag)
  • public bool setupRegisterInfo(const llvm::PerFunctionMIParsingState & PFS, const yaml::MachineFunction & YamlMF)

Methods

MIRParserImpl(
    std::unique_ptr<MemoryBuffer> Contents,
    llvm::StringRef Filename,
    llvm::LLVMContext& Context,
    std::function<void(Function&)>
        ProcessIRFunction)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:70

Parameters

std::unique_ptr<MemoryBuffer> Contents
llvm::StringRef Filename
llvm::LLVMContext& Context
std::function<void(Function&)> ProcessIRFunction

llvm::Function* createDummyFunction(
    llvm::StringRef Name,
    llvm::Module& M)

Description

Create an empty function with the given name.

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:99

Parameters

llvm::StringRef Name
llvm::Module& M

bool error(const llvm::Twine& Message)

Description

Report an error with the given message at unknown location. Always returns true.

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:79

Parameters

const llvm::Twine& Message

bool error(llvm::SMLoc Loc,
           const llvm::Twine& Message)

Description

Report an error with the given message at the given location. Always returns true.

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:84

Parameters

llvm::SMLoc Loc
const llvm::Twine& Message

bool error(const llvm::SMDiagnostic& Error,
           llvm::SMRange SourceRange)

Description

Report a given error with the location translated from the location in an embedded string literal to a location in the MIR file. Always returns true.

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:90

Parameters

const llvm::SMDiagnostic& Error
llvm::SMRange SourceRange

bool initializeCallSiteInfo(
    llvm::PerFunctionMIParsingState& PFS,
    const yaml::MachineFunction& YamlMF)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:125

Parameters

llvm::PerFunctionMIParsingState& PFS
const yaml::MachineFunction& YamlMF

bool initializeConstantPool(
    llvm::PerFunctionMIParsingState& PFS,
    llvm::MachineConstantPool& ConstantPool,
    const yaml::MachineFunction& YamlMF)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:138

Parameters

llvm::PerFunctionMIParsingState& PFS
llvm::MachineConstantPool& ConstantPool
const yaml::MachineFunction& YamlMF

bool initializeFrameInfo(
    llvm::PerFunctionMIParsingState& PFS,
    const yaml::MachineFunction& YamlMF)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:122

Parameters

llvm::PerFunctionMIParsingState& PFS
const yaml::MachineFunction& YamlMF

bool initializeJumpTableInfo(
    llvm::PerFunctionMIParsingState& PFS,
    const yaml::MachineJumpTable& YamlJTI)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:142

Parameters

llvm::PerFunctionMIParsingState& PFS
const yaml::MachineJumpTable& YamlJTI

bool initializeMachineFunction(
    const yaml::MachineFunction& YamlMF,
    llvm::MachineFunction& MF)

Description

Initialize the machine function to the state that's described in the MIR file. Return true if error occurred.

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:113

Parameters

const yaml::MachineFunction& YamlMF
llvm::MachineFunction& MF

bool parseCalleeSavedRegister(
    llvm::PerFunctionMIParsingState& PFS,
    std::vector<CalleeSavedInfo>& CSIInfo,
    const yaml::StringValue& RegisterSource,
    bool IsRestored,
    int FrameIdx)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:128

Parameters

llvm::PerFunctionMIParsingState& PFS
std::vector<CalleeSavedInfo>& CSIInfo
const yaml::StringValue& RegisterSource
bool IsRestored
int FrameIdx

std::unique_ptr<Module> parseIRModule()

Description

Try to parse the optional LLVM module and the machine functions in the MIR file. Return null if an error occurred.

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:96

bool parseMachineFunction(
    llvm::Module& M,
    llvm::MachineModuleInfo& MMI)

Description

Parse the machine function in the current YAML document. Return true if an error occurred.

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:107

Parameters

llvm::Module& M
llvm::MachineModuleInfo& MMI

bool parseMachineFunctions(
    llvm::Module& M,
    llvm::MachineModuleInfo& MMI)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:101

Parameters

llvm::Module& M
llvm::MachineModuleInfo& MMI

bool parseRegisterInfo(
    llvm::PerFunctionMIParsingState& PFS,
    const yaml::MachineFunction& YamlMF)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:116

Parameters

llvm::PerFunctionMIParsingState& PFS
const yaml::MachineFunction& YamlMF

template <typename T>
bool parseStackObjectsDebugInfo(
    llvm::PerFunctionMIParsingState& PFS,
    const T& Object,
    int FrameIdx)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:134

Templates

T

Parameters

llvm::PerFunctionMIParsingState& PFS
const T& Object
int FrameIdx

void reportDiagnostic(
    const llvm::SMDiagnostic& Diag)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:74

Parameters

const llvm::SMDiagnostic& Diag

bool setupRegisterInfo(
    const llvm::PerFunctionMIParsingState& PFS,
    const yaml::MachineFunction& YamlMF)

Declared at: llvm/lib/CodeGen/MIRParser/MIRParser.cpp:119

Parameters

const llvm::PerFunctionMIParsingState& PFS
const yaml::MachineFunction& YamlMF