LLVM API Documentation

Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes
llvm::MachineModuleInfo Class Reference

#include <MachineModuleInfo.h>

Inheritance diagram for llvm::MachineModuleInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::MachineModuleInfo:
Collaboration graph
[legend]

List of all members.

Classes

struct  VariableDbgInfo

Public Types

typedef SmallVector
< VariableDbgInfo, 4 > 
VariableDbgInfoMapTy

Public Member Functions

 MachineModuleInfo ()
 MachineModuleInfo (const MCAsmInfo &MAI, const MCRegisterInfo &MRI, const MCObjectFileInfo *MOFI)
 ~MachineModuleInfo ()
bool doInitialization (Module &) override
bool doFinalization (Module &) override
void EndFunction ()
const MCContextgetContext () const
MCContextgetContext ()
void setModule (const Module *M)
const ModulegetModule () const
template<typename Ty >
Ty & getObjFileInfo ()
template<typename Ty >
const Ty & getObjFileInfo () const
void AnalyzeModule (const Module &M)
bool hasDebugInfo () const
void setDebugInfoAvailability (bool avail)
bool callsEHReturn () const
void setCallsEHReturn (bool b)
bool callsUnwindInit () const
void setCallsUnwindInit (bool b)
bool usesVAFloatArgument () const
void setUsesVAFloatArgument (bool b)
const std::vector
< MCCFIInstruction > & 
getFrameInstructions () const
 Returns a reference to a list of cfi instructions in the current function's prologue. Used to construct frame maps for debug and exception handling comsumers.
unsigned
LLVM_ATTRIBUTE_UNUSED_RESULT 
addFrameInst (const MCCFIInstruction &Inst)
MCSymbolgetAddrLabelSymbol (const BasicBlock *BB)
std::vector< MCSymbol * > getAddrLabelSymbolToEmit (const BasicBlock *BB)
void takeDeletedSymbolsForFunction (const Function *F, std::vector< MCSymbol * > &Result)
LandingPadInfogetOrCreateLandingPadInfo (MachineBasicBlock *LandingPad)
void addInvoke (MachineBasicBlock *LandingPad, MCSymbol *BeginLabel, MCSymbol *EndLabel)
MCSymboladdLandingPad (MachineBasicBlock *LandingPad)
void addPersonality (MachineBasicBlock *LandingPad, const Function *Personality)
unsigned getPersonalityIndex () const
const std::vector< const
Function * > & 
getPersonalities () const
 getPersonalities - Return array of personality functions ever seen.
bool isUsedFunction (const Function *F) const
void addCatchTypeInfo (MachineBasicBlock *LandingPad, ArrayRef< const GlobalVariable * > TyInfo)
void addFilterTypeInfo (MachineBasicBlock *LandingPad, ArrayRef< const GlobalVariable * > TyInfo)
void addCleanup (MachineBasicBlock *LandingPad)
unsigned getTypeIDFor (const GlobalVariable *TI)
int getFilterIDFor (std::vector< unsigned > &TyIds)
void TidyLandingPads (DenseMap< MCSymbol *, uintptr_t > *LPMap=nullptr)
const std::vector
< LandingPadInfo > & 
getLandingPads () const
void setCallSiteLandingPad (MCSymbol *Sym, ArrayRef< unsigned > Sites)
SmallVectorImpl< unsigned > & getCallSiteLandingPad (MCSymbol *Sym)
bool hasCallSiteLandingPad (MCSymbol *Sym)
void setCallSiteBeginLabel (MCSymbol *BeginLabel, unsigned Site)
 setCallSiteBeginLabel - Map the begin label for a call site.
unsigned getCallSiteBeginLabel (MCSymbol *BeginLabel)
 getCallSiteBeginLabel - Get the call site number for a begin label.
bool hasCallSiteBeginLabel (MCSymbol *BeginLabel)
void setCurrentCallSite (unsigned Site)
 setCurrentCallSite - Set the call site currently being processed.
unsigned getCurrentCallSite ()
const std::vector< const
GlobalVariable * > & 
getTypeInfos () const
const std::vector< unsigned > & getFilterIds () const
const FunctiongetPersonality () const
 getPersonality - Return the personality function for the current function.
void setVariableDbgInfo (MDNode *N, unsigned Slot, DebugLoc Loc)
VariableDbgInfoMapTygetVariableDbgInfo ()

Public Attributes

VariableDbgInfoMapTy VariableDbgInfos

Static Public Attributes

static char ID

Detailed Description

MachineModuleInfo - 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 97 of file MachineModuleInfo.h.


Member Typedef Documentation

Definition at line 172 of file MachineModuleInfo.h.


Constructor & Destructor Documentation

Definition at line 260 of file MachineModuleInfo.cpp.

References llvm_unreachable.

Definition at line 267 of file MachineModuleInfo.cpp.


Member Function Documentation

addCatchTypeInfo - Provide the catch typeinfo for a landing pad.

Definition at line 429 of file MachineModuleInfo.cpp.

References getOrCreateLandingPadInfo(), getTypeIDFor(), N, llvm::ArrayRef< T >::size(), and llvm::LandingPadInfo::TypeIds.

Referenced by llvm::AddCatchInfo(), and llvm::AddLandingPadInfo().

addCleanup - Add a cleanup action for a landing pad.

Definition at line 450 of file MachineModuleInfo.cpp.

References getOrCreateLandingPadInfo(), and llvm::LandingPadInfo::TypeIds.

Referenced by llvm::AddCatchInfo(), and llvm::AddLandingPadInfo().

addFilterTypeInfo - Provide the filter typeinfo for a landing pad.

Definition at line 439 of file MachineModuleInfo.cpp.

References getFilterIDFor(), getOrCreateLandingPadInfo(), getTypeIDFor(), I, llvm::ArrayRef< T >::size(), and llvm::LandingPadInfo::TypeIds.

Referenced by llvm::AddCatchInfo(), and llvm::AddLandingPadInfo().

void MachineModuleInfo::addInvoke ( MachineBasicBlock LandingPad,
MCSymbol BeginLabel,
MCSymbol EndLabel 
)

addInvoke - Provide the begin and end labels of an invoke style call and associate it with a try landing pad block.

Definition at line 391 of file MachineModuleInfo.cpp.

References llvm::LandingPadInfo::BeginLabels, llvm::LandingPadInfo::EndLabels, getOrCreateLandingPadInfo(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by llvm::SelectionDAGBuilder::LowerCallTo().

addLandingPad - Add a new panding pad. Returns the label ID for the landing pad entry.

addLandingPad - Provide the label of a try LandingPad block.

Definition at line 400 of file MachineModuleInfo.cpp.

References llvm::MCContext::CreateTempSymbol(), getOrCreateLandingPadInfo(), and llvm::LandingPadInfo::LandingPadLabel.

void MachineModuleInfo::addPersonality ( MachineBasicBlock LandingPad,
const Function Personality 
)

addPersonality - Provide the personality function for the exception information.

Definition at line 409 of file MachineModuleInfo.cpp.

References getOrCreateLandingPadInfo(), and llvm::LandingPadInfo::Personality.

Referenced by llvm::AddCatchInfo(), and llvm::AddLandingPadInfo().

bool MachineModuleInfo::doFinalization ( Module ) [override, virtual]

doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run.

Reimplemented from llvm::Pass.

Definition at line 285 of file MachineModuleInfo.cpp.

References llvm::MCContext::reset().

bool MachineModuleInfo::doInitialization ( Module ) [override, virtual]

doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run.

Reimplemented from llvm::Pass.

Definition at line 270 of file MachineModuleInfo.cpp.

EndFunction - Discard function meta information.

Definition at line 302 of file MachineModuleInfo.cpp.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), llvm::SmallVectorImpl< T >::clear(), and VariableDbgInfos.

Referenced by llvm::AsmPrinter::EmitFunctionBody().

getAddrLabelSymbol - 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 340 of file MachineModuleInfo.cpp.

References llvm::MMIAddrLabelMap::getAddrLabelSymbol().

Referenced by llvm::AsmPrinter::GetBlockAddressSymbol().

getAddrLabelSymbolToEmit - 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 351 of file MachineModuleInfo.cpp.

References llvm::MMIAddrLabelMap::getAddrLabelSymbolToEmit().

Referenced by llvm::AsmPrinter::EmitBasicBlockStart().

getCallSiteBeginLabel - Get the call site number for a begin label.

Definition at line 356 of file MachineModuleInfo.h.

References hasCallSiteBeginLabel().

Referenced by llvm::EHStreamer::computeCallSiteTable().

getCallSiteLandingPad - Get the call site indexes for a landing pad EH symbol.

Definition at line 338 of file MachineModuleInfo.h.

References hasCallSiteLandingPad().

Definition at line 190 of file MachineModuleInfo.h.

getCurrentCallSite - Get the call site currently being processed, if any. return zero if none.

Definition at line 373 of file MachineModuleInfo.h.

Referenced by llvm::SelectionDAGBuilder::LowerCallTo().

int MachineModuleInfo::getFilterIDFor ( std::vector< unsigned > &  TyIds)

getFilterIDFor - Return the id of the filter encoded by TyIds. This is function wide.

getFilterIDFor - Return the filter id for the specified typeinfos. This is function wide.

Definition at line 519 of file MachineModuleInfo.cpp.

References I.

Referenced by addFilterTypeInfo().

const std::vector<unsigned>& llvm::MachineModuleInfo::getFilterIds ( ) const [inline]

getFilterIds - Return a reference to the typeids encoding filters used in the current function.

Definition at line 383 of file MachineModuleInfo.h.

Referenced by llvm::EHStreamer::computeActionsTable(), llvm::EHStreamer::emitExceptionTable(), and llvm::EHStreamer::emitTypeInfos().

Returns a reference to a list of cfi instructions in the current function's prologue. Used to construct frame maps for debug and exception handling comsumers.

Definition at line 236 of file MachineModuleInfo.h.

Referenced by llvm::AsmPrinter::emitCFIInstruction().

getLandingPads - Return a reference to the landing pad info for the current function.

Definition at line 328 of file MachineModuleInfo.h.

Referenced by llvm::Win64Exception::beginFunction(), llvm::DwarfCFIException::beginFunction(), llvm::EHStreamer::emitExceptionTable(), and llvm::ARMException::endFunction().

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

Definition at line 206 of file MachineModuleInfo.h.

getOrCreateLandingPadInfo - Find or create an LandingPadInfo for the specified MachineBasicBlock.

Definition at line 377 of file MachineModuleInfo.cpp.

References llvm::LandingPadInfo::LandingPadBlock, and N.

Referenced by addCatchTypeInfo(), addCleanup(), addFilterTypeInfo(), addInvoke(), addLandingPad(), and addPersonality().

const std::vector<const Function *>& llvm::MachineModuleInfo::getPersonalities ( ) const [inline]

getPersonalities - Return array of personality functions ever seen.

Definition at line 289 of file MachineModuleInfo.h.

Referenced by llvm::Win64Exception::beginFunction(), llvm::DwarfCFIException::beginFunction(), llvm::ARMException::endFunction(), and llvm::DwarfCFIException::endModule().

getPersonality - Return the personality function for the current function.

getPersonality - Return a personality function if available. The presence of one is required to emit exception handling info.

Definition at line 548 of file MachineModuleInfo.cpp.

getPersonalityIndex - Get index of the current personality function inside Personalitites array

getPersonalityIndex - Return unique index for current personality function. NULL/first personality function should always get zero index.

Definition at line 556 of file MachineModuleInfo.cpp.

Referenced by llvm::Win64Exception::beginFunction(), llvm::DwarfCFIException::beginFunction(), and llvm::ARMException::endFunction().

getTypeIDFor - Return the type id for the specified typeinfo. This is function wide.

Definition at line 509 of file MachineModuleInfo.cpp.

References N.

Referenced by addCatchTypeInfo(), and addFilterTypeInfo().

getTypeInfos - Return a reference to the C++ typeinfo for the current function.

Definition at line 377 of file MachineModuleInfo.h.

Referenced by llvm::EHStreamer::emitExceptionTable(), and llvm::EHStreamer::emitTypeInfos().

Definition at line 398 of file MachineModuleInfo.h.

References VariableDbgInfos.

hasCallSiteBeginLabel - Return true if the begin label has a call site number associated with it.

Definition at line 364 of file MachineModuleInfo.h.

Referenced by getCallSiteBeginLabel().

hasCallSiteLandingPad - Return true if the landing pad Eh symbol has an associated call site.

Definition at line 346 of file MachineModuleInfo.h.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::empty().

Referenced by getCallSiteLandingPad().

isUsedFunction - Return true if the functions in the llvm.used list. This does not return true for things in llvm.compiler.used unless they are also in llvm.used.

Definition at line 296 of file MachineModuleInfo.h.

References llvm::SmallPtrSetImpl< PtrType >::count().

Definition at line 220 of file MachineModuleInfo.h.

void llvm::MachineModuleInfo::setCallSiteBeginLabel ( MCSymbol BeginLabel,
unsigned  Site 
) [inline]

setCallSiteBeginLabel - Map the begin label for a call site.

Definition at line 351 of file MachineModuleInfo.h.

Referenced by llvm::SelectionDAGBuilder::LowerCallTo().

setCallSiteLandingPad - Map the landing pad's EH symbol to the call site indexes.

Definition at line 502 of file MachineModuleInfo.cpp.

References llvm::ArrayRef< T >::begin(), and llvm::ArrayRef< T >::end().

Definition at line 223 of file MachineModuleInfo.h.

setCurrentCallSite - Set the call site currently being processed.

Definition at line 369 of file MachineModuleInfo.h.

Referenced by llvm::SelectionDAGBuilder::LowerCallTo().

Definition at line 192 of file MachineModuleInfo.h.

Definition at line 229 of file MachineModuleInfo.h.

Referenced by llvm::ComputeUsesVAFloatArgument().

void llvm::MachineModuleInfo::setVariableDbgInfo ( MDNode N,
unsigned  Slot,
DebugLoc  Loc 
) [inline]

setVariableDbgInfo - Collect information used to emit debugging information of a variable.

Definition at line 393 of file MachineModuleInfo.h.

References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and VariableDbgInfos.

Referenced by llvm::FunctionLoweringInfo::set().

void MachineModuleInfo::takeDeletedSymbolsForFunction ( const Function F,
std::vector< MCSymbol * > &  Result 
)

takeDeletedSymbolsForFunction - 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 364 of file MachineModuleInfo.cpp.

Referenced by llvm::AsmPrinter::EmitFunctionHeader().

void MachineModuleInfo::TidyLandingPads ( DenseMap< MCSymbol *, uintptr_t > *  LPMap = nullptr)

Member Data Documentation

Definition at line 165 of file MachineModuleInfo.h.

Definition at line 173 of file MachineModuleInfo.h.

Referenced by EndFunction(), getVariableDbgInfo(), and setVariableDbgInfo().


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