LLVM
8.0.1
|
This class contains meta information specific to a module. More...
#include "llvm/CodeGen/MachineModuleInfo.h"
Public Member Functions | |
MachineModuleInfo (const LLVMTargetMachine *TM=nullptr) | |
~MachineModuleInfo () override | |
bool | doInitialization (Module &) override |
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run. More... | |
bool | doFinalization (Module &) override |
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run. More... | |
const MCContext & | getContext () const |
MCContext & | getContext () |
const Module * | getModule () const |
MachineFunction & | getOrCreateMachineFunction (const Function &F) |
Returns the MachineFunction constructed for the IR function F . More... | |
MachineFunction * | getMachineFunction (const Function &F) const |
Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr. More... | |
void | deleteMachineFunctionFor (Function &F) |
Delete the MachineFunction MF and reset the link in the IR Function to Machine Function map. More... | |
template<typename Ty > | |
Ty & | getObjFileInfo () |
Keep track of various per-function pieces of information for backends that would like to do so. More... | |
template<typename Ty > | |
const Ty & | getObjFileInfo () const |
bool | hasDebugInfo () const |
Returns true if valid debug info is present. More... | |
void | setDebugInfoAvailability (bool avail) |
bool | usesVAFloatArgument () const |
void | setUsesVAFloatArgument (bool b) |
bool | usesMorestackAddr () const |
void | setUsesMorestackAddr (bool b) |
bool | hasSplitStack () const |
void | setHasSplitStack (bool b) |
bool | hasNosplitStack () const |
void | setHasNosplitStack (bool b) |
MCSymbol * | getAddrLabelSymbol (const BasicBlock *BB) |
Return the symbol to be used for the specified basic block when its address is taken. More... | |
ArrayRef< MCSymbol * > | getAddrLabelSymbolToEmit (const BasicBlock *BB) |
Return the symbol to be used for the specified basic block when its address is taken. More... | |
void | takeDeletedSymbolsForFunction (const Function *F, std::vector< MCSymbol *> &Result) |
If the specified function has had any references to address-taken blocks generated, but the block got deleted, return the symbol now so we can emit it. More... | |
Public Member Functions inherited from llvm::ImmutablePass | |
ImmutablePass (char &pid) | |
~ImmutablePass () override | |
virtual void | initializePass () |
initializePass - This method may be overriden by immutable passes to allow them to perform various initialization actions they require. More... | |
ImmutablePass * | getAsImmutablePass () override |
bool | runOnModule (Module &) override |
ImmutablePasses are never run. More... | |
Public Member Functions inherited from llvm::ModulePass | |
ModulePass (char &pid) | |
~ModulePass () override | |
Pass * | createPrinterPass (raw_ostream &OS, const std::string &Banner) const override |
createPrinterPass - Get a module printer pass. More... | |
void | assignPassManager (PMStack &PMS, PassManagerType T) override |
Find appropriate Module Pass Manager in the PM Stack and add self into that manager. More... | |
PassManagerType | getPotentialPassManagerType () const override |
Return what kind of Pass Manager can manage this pass. More... | |
Public Member Functions inherited from llvm::Pass | |
Pass (PassKind K, char &pid) | |
Pass (const Pass &)=delete | |
Pass & | operator= (const Pass &)=delete |
virtual | ~Pass () |
PassKind | getPassKind () const |
virtual StringRef | getPassName () const |
getPassName - Return a nice clean name for a pass. More... | |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. More... | |
virtual void | print (raw_ostream &OS, const Module *M) const |
print - Print out the internal state of the pass. More... | |
void | dump () const |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. More... | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void | getAnalysisUsage (AnalysisUsage &) const |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. More... | |
virtual void | releaseMemory () |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. More... | |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance. More... | |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | verifyAnalysis () const |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information. More... | |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. More... | |
bool | mustPreserveAnalysisID (char &AID) const |
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. More... | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More... | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F) |
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More... | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Attributes | |
static char | ID |
Exception Handling | |
void | setCurrentCallSite (unsigned Site) |
Set the call site currently being processed. More... | |
unsigned | getCurrentCallSite () |
Get the call site currently being processed, if any. More... | |
void | addPersonality (const Function *Personality) |
Provide the personality function for the exception information. More... | |
const std::vector< const Function * > & | getPersonalities () const |
Return array of personality functions ever seen. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::Pass | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
Protected Member Functions inherited from llvm::ModulePass | |
bool | skipModule (Module &M) const |
Optional passes call this function to check whether the pass should be skipped. More... | |
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 78 of file MachineModuleInfo.h.
|
explicit |
Definition at line 197 of file MachineModuleInfo.cpp.
References llvm::PassRegistry::getPassRegistry(), llvm::initializeMachineModuleInfoPass(), and ~MachineModuleInfo().
|
overridedefault |
Referenced by MachineModuleInfo().
Provide the personality function for the exception information.
Definition at line 253 of file MachineModuleInfo.cpp.
Referenced by llvm::MachineFunction::addLandingPad(), and llvm::DwarfCFIException::beginFragment().
void MachineModuleInfo::deleteMachineFunctionFor | ( | Function & | F | ) |
Delete the MachineFunction MF
and reset the link in the IR Function to Machine Function map.
Definition at line 293 of file MachineModuleInfo.cpp.
References llvm::AnalysisUsage::addPreserved(), llvm::AnalysisUsage::addRequired(), deleteMachineFunctionFor(), F(), llvm::Pass::getAnalysisUsage(), llvm::Pass::getPassName(), ID, and runOnFunction().
Referenced by deleteMachineFunctionFor().
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run.
Reimplemented from llvm::Pass.
Definition at line 217 of file MachineModuleInfo.cpp.
References llvm::MCContext::reset().
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run.
Reimplemented from llvm::Pass.
Definition at line 206 of file MachineModuleInfo.cpp.
References llvm::Module::debug_compile_units(), and llvm::empty().
|
inline |
Return the symbol to be used for the specified basic block when its address is taken.
This cannot be its normal LBB label because the block may be accessed outside its containing function.
Definition at line 225 of file MachineModuleInfo.h.
Referenced by llvm::AsmPrinter::GetBlockAddressSymbol().
ArrayRef< MCSymbol * > MachineModuleInfo::getAddrLabelSymbolToEmit | ( | const BasicBlock * | BB | ) |
Return the symbol to be used for the specified basic block when its address is taken.
If other blocks were RAUW'd to this one, we may have to emit them as well, return the whole set.
Definition at line 234 of file MachineModuleInfo.cpp.
References llvm::MMIAddrLabelMap::getAddrLabelSymbolToEmit(), and takeDeletedSymbolsForFunction().
Referenced by llvm::AsmPrinter::EmitBasicBlockStart().
Definition at line 155 of file MachineModuleInfo.h.
References Context.
Referenced by llvm::LLVMTargetMachine::addPassesToEmitFile(), llvm::LLVMTargetMachine::addPassesToEmitMC(), llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::DwarfCFIException::beginFunction(), llvm::DebugHandlerBase::beginInstruction(), llvm::CodeViewDebug::beginInstruction(), CallingConvSupported(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), emitNonLazyStubs(), llvm::Mips16FrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::SystemZFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::X86AsmPrinter::EmitStartOfAsmFile(), llvm::DebugHandlerBase::endInstruction(), getSymbolName(), getUnderlyingArgReg(), llvm::HexagonFrameLowering::insertCFIInstructions(), llvm::SelectionDAGBuilder::lowerInvokable(), recoverFramePointer(), and srcMgrDiagHandler().
|
inline |
Definition at line 156 of file MachineModuleInfo.h.
References Context.
|
inline |
Get the call site currently being processed, if any.
return zero if none.
Definition at line 249 of file MachineModuleInfo.h.
Referenced by getUnderlyingArgReg(), and llvm::SelectionDAGBuilder::lowerInvokable().
MachineFunction * MachineModuleInfo::getMachineFunction | ( | const Function & | F | ) | const |
Returns the MachineFunction associated to IR function F
if there is one, otherwise nullptr.
Definition at line 263 of file MachineModuleInfo.cpp.
References I.
Referenced by llvm::AArch64InstrInfo::getOutliningType(), INITIALIZE_PASS(), and llvm::MIRParserImpl::parseMachineFunction().
Definition at line 158 of file MachineModuleInfo.h.
References F().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::AMDGPUMachineModuleInfo::AMDGPUMachineModuleInfo(), llvm::DwarfDebug::beginModule(), checkFunctionsAttributeConsistency(), llvm::CodeViewDebug::CodeViewDebug(), llvm::createX86IndirectBranchTrackingPass(), llvm::AsmPrinter::doInitialization(), llvm::DwarfDebug::DwarfDebug(), llvm::MachineInstr::emitError(), EmitGCCInlineAsmStr(), EmitMSInlineAsmStr(), llvm::X86FrameLowering::emitPrologue(), llvm::WinCFGuard::endModule(), llvm::WinException::endModule(), llvm::BTFDebug::endModule(), llvm::X86TargetLowering::expandIndirectJTBranch(), llvm::AsmPrinter::getDataLayout(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), getMOVL(), getRetpolineSymbol(), getStringIdTypeIdx(), getSymbolName(), parseVersion(), llvm::X86AsmPrinter::runOnMachineFunction(), and srcMgrDiagHandler().
|
inline |
Keep track of various per-function pieces of information for backends that would like to do so.
Definition at line 175 of file MachineModuleInfo.h.
Referenced by llvm::AsmPrinter::doFinalization(), llvm::ARMAsmPrinter::EmitEndOfAsmFile(), emitNonLazyStubs(), llvm::TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(), llvm::AArch64MCInstLower::GetGlobalAddressSymbol(), llvm::TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(), getMachOMMI(), getModifierVariantKind(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), and printSymbolOperand().
|
inline |
Definition at line 182 of file MachineModuleInfo.h.
MachineFunction & MachineModuleInfo::getOrCreateMachineFunction | ( | const Function & | F | ) |
Returns the MachineFunction constructed for the IR function F
.
Creates a new MachineFunction if none exists yet.
Definition at line 269 of file MachineModuleInfo.cpp.
References F(), llvm::TargetMachine::getSubtargetImpl(), and I.
Referenced by INITIALIZE_PASS(), and llvm::MIRParserImpl::parseMachineFunction().
Return array of personality functions ever seen.
Definition at line 255 of file MachineModuleInfo.h.
References llvm::computeUsesVAFloatArgument(), and I.
Referenced by llvm::DwarfCFIException::endModule().
|
inline |
Returns true if valid debug info is present.
Definition at line 187 of file MachineModuleInfo.h.
Referenced by llvm::DebugHandlerBase::beginInstruction(), llvm::DwarfDebug::beginModule(), llvm::createSIDebuggerInsertNopsPass(), llvm::NVPTXAsmPrinter::doFinalization(), llvm::NVPTXAsmPrinter::doInitialization(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::emitEpilogue(), llvm::AsmPrinter::EmitFunctionBody(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::DebugHandlerBase::endInstruction(), llvm::CodeViewDebug::endModule(), llvm::DwarfDebug::endModule(), ExpandMOVImmSExti8(), hasDebugInfo(), needFuncLabelsForEHOrDebugInfo(), llvm::AsmPrinter::needsCFIMoves(), llvm::XCoreRegisterInfo::needsFrameMoves(), and llvm::ARCRegisterInfo::needsFrameMoves().
|
inline |
Definition at line 214 of file MachineModuleInfo.h.
Referenced by llvm::AsmPrinter::doFinalization().
|
inline |
Definition at line 206 of file MachineModuleInfo.h.
Referenced by llvm::AsmPrinter::doFinalization().
|
inline |
Set the call site currently being processed.
Definition at line 245 of file MachineModuleInfo.h.
Referenced by getUnderlyingArgReg(), and llvm::SelectionDAGBuilder::lowerInvokable().
|
inline |
Definition at line 188 of file MachineModuleInfo.h.
Referenced by llvm::DwarfDebug::beginModule(), and llvm::CodeViewDebug::CodeViewDebug().
|
inline |
Definition at line 218 of file MachineModuleInfo.h.
Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::X86FrameLowering::adjustForSegmentedStacks(), and AssignProtectedObjSet().
|
inline |
Definition at line 210 of file MachineModuleInfo.h.
Referenced by AssignProtectedObjSet().
|
inline |
Definition at line 202 of file MachineModuleInfo.h.
Referenced by llvm::X86FrameLowering::adjustForSegmentedStacks().
|
inline |
Definition at line 194 of file MachineModuleInfo.h.
Referenced by llvm::computeUsesVAFloatArgument().
void MachineModuleInfo::takeDeletedSymbolsForFunction | ( | const Function * | F, |
std::vector< MCSymbol *> & | Result | ||
) |
If the specified function has had any references to address-taken blocks generated, but the block got deleted, return the symbol now so we can emit it.
This prevents emitting a reference to a symbol that has no definition.
Definition at line 242 of file MachineModuleInfo.cpp.
Referenced by llvm::AsmPrinter::EmitDebugValue(), and getAddrLabelSymbolToEmit().
|
inline |
Definition at line 198 of file MachineModuleInfo.h.
Referenced by llvm::AsmPrinter::doFinalization().
|
inline |
Definition at line 190 of file MachineModuleInfo.h.
Referenced by llvm::computeUsesVAFloatArgument(), and llvm::X86AsmPrinter::EmitEndOfAsmFile().
|
static |
Definition at line 146 of file MachineModuleInfo.h.
Referenced by deleteMachineFunctionFor().