LLVM 23.0.0git
llvm::MachineModuleInfo Class Reference

This class contains meta information specific to a module. More...

#include "llvm/CodeGen/MachineModuleInfo.h"

Public Member Functions

LLVM_ABI MachineModuleInfo (const TargetMachine *TM=nullptr)
LLVM_ABI MachineModuleInfo (const TargetMachine *TM, MCContext *ExtContext)
LLVM_ABI MachineModuleInfo (MachineModuleInfo &&MMII)
LLVM_ABI ~MachineModuleInfo ()
LLVM_ABI void initialize ()
LLVM_ABI void finalize ()
const TargetMachinegetTarget () const
const MCContextgetContext () const
MCContextgetContext ()
const ModulegetModule () const
LLVM_ABI MachineFunctiongetOrCreateMachineFunction (Function &F)
 Returns the MachineFunction constructed for the IR function F.
LLVM_ABI MachineFunctiongetMachineFunction (const Function &F) const
 Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.
LLVM_ABI void deleteMachineFunctionFor (Function &F)
 Delete the MachineFunction MF and reset the link in the IR Function to Machine Function map.
LLVM_ABI void insertFunction (const Function &F, std::unique_ptr< MachineFunction > &&MF)
 Add an externally created MachineFunction MF for F.
template<typename Ty>
Ty & getObjFileInfo ()
 Keep track of various per-module pieces of information for backends that would like to do so.
template<typename Ty>
const Ty & getObjFileInfo () const

Friends

class MachineModuleInfoWrapperPass
class MachineModuleAnalysis

Detailed Description

This class contains meta information specific to a module.

Queries can be made by different debugging and exception handling schemes and reformated for specific use.

Definition at line 83 of file MachineModuleInfo.h.

Constructor & Destructor Documentation

◆ MachineModuleInfo() [1/3]

MachineModuleInfo::MachineModuleInfo ( const TargetMachine * TM = nullptr)
explicit

Definition at line 51 of file MachineModuleInfo.cpp.

References initialize().

Referenced by getObjFileInfo(), MachineModuleAnalysis, and MachineModuleInfo().

◆ MachineModuleInfo() [2/3]

MachineModuleInfo::MachineModuleInfo ( const TargetMachine * TM,
MCContext * ExtContext )
explicit

Definition at line 59 of file MachineModuleInfo.cpp.

References initialize().

◆ MachineModuleInfo() [3/3]

MachineModuleInfo::MachineModuleInfo ( MachineModuleInfo && MMII)

Definition at line 40 of file MachineModuleInfo.cpp.

References MachineModuleInfo(), and llvm::move().

◆ ~MachineModuleInfo()

MachineModuleInfo::~MachineModuleInfo ( )

Definition at line 69 of file MachineModuleInfo.cpp.

References finalize().

Member Function Documentation

◆ deleteMachineFunctionFor()

void MachineModuleInfo::deleteMachineFunctionFor ( Function & F)

Delete the MachineFunction MF and reset the link in the IR Function to Machine Function map.

Definition at line 106 of file MachineModuleInfo.cpp.

References llvm::MachineFunction::erase(), and F.

◆ finalize()

void MachineModuleInfo::finalize ( )

Definition at line 32 of file MachineModuleInfo.cpp.

Referenced by ~MachineModuleInfo().

◆ getContext() [1/2]

MCContext & llvm::MachineModuleInfo::getContext ( )
inline

Definition at line 130 of file MachineModuleInfo.h.

◆ getContext() [2/2]

◆ getMachineFunction()

MachineFunction * MachineModuleInfo::getMachineFunction ( const Function & F) const

Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.

NOTE: New pass manager clients shall not use this method to get the MachineFunction, use MachineFunctionAnalysis instead.

Definition at line 72 of file MachineModuleInfo.cpp.

References F, and I.

Referenced by addDecorations(), addMBBNames(), collectReqs(), llvm::ARMBaseInstrInfo::getOutliningTypeImpl(), llvm::MIRParserImpl::parseMachineFunction(), patchPhis(), and llvm::printMIR().

◆ getModule()

◆ getObjFileInfo() [1/2]

◆ getObjFileInfo() [2/2]

template<typename Ty>
const Ty & llvm::MachineModuleInfo::getObjFileInfo ( ) const
inline

Definition at line 166 of file MachineModuleInfo.h.

References getObjFileInfo(), and MachineModuleInfo().

◆ getOrCreateMachineFunction()

MachineFunction & MachineModuleInfo::getOrCreateMachineFunction ( Function & F)

Returns the MachineFunction constructed for the IR function F.

Creates a new MachineFunction if none exists yet. NOTE: New pass manager clients shall not use this method to get the MachineFunction, use MachineFunctionAnalysis instead.

Definition at line 77 of file MachineModuleInfo.cpp.

References F, getContext(), I, and llvm::MachineFunction::initTargetMachineFunctionInfo().

Referenced by createFrameHelperMachineFunction(), llvm::ThunkInserter< Derived, InsertedThunksTy >::createThunkFunction(), and llvm::MIRParserImpl::parseMachineFunction().

◆ getTarget()

const TargetMachine & llvm::MachineModuleInfo::getTarget ( ) const
inline

◆ initialize()

void MachineModuleInfo::initialize ( )

Definition at line 27 of file MachineModuleInfo.cpp.

Referenced by MachineModuleInfo(), and MachineModuleInfo().

◆ insertFunction()

void MachineModuleInfo::insertFunction ( const Function & F,
std::unique_ptr< MachineFunction > && MF )

Add an externally created MachineFunction MF for F.

Definition at line 112 of file MachineModuleInfo.cpp.

References assert(), F, and I.

◆ MachineModuleAnalysis

friend class MachineModuleAnalysis
friend

Definition at line 85 of file MachineModuleInfo.h.

References LLVM_ABI, MachineModuleAnalysis, and MachineModuleInfo().

Referenced by MachineModuleAnalysis.

◆ MachineModuleInfoWrapperPass

friend class MachineModuleInfoWrapperPass
friend

Definition at line 84 of file MachineModuleInfo.h.

References MachineModuleInfoWrapperPass.

Referenced by MachineModuleInfoWrapperPass.


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