LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
llvm::MachineModuleInfo Class Reference

#include <MachineModuleInfo.h>

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

Public Types

typedef std::pair< unsigned,
DebugLoc
UnsignedDebugLocPair
 
typedef SmallVector< std::pair
< TrackingVH< MDNode >
, UnsignedDebugLocPair >, 4 > 
VariableDbgInfoMapTy
 

Public Member Functions

 MachineModuleInfo ()
 
 MachineModuleInfo (const MCAsmInfo &MAI, const MCRegisterInfo &MRI, const MCObjectFileInfo *MOFI)
 
 ~MachineModuleInfo ()
 
virtual bool doInitialization (Module &)
 
virtual bool doFinalization (Module &)
 
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. More...
 
void addFrameInst (const MCCFIInstruction &Inst)
 
uint32_t getCompactUnwindEncoding () const
 
void setCompactUnwindEncoding (uint32_t Enc)
 
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. More...
 
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=0)
 
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. More...
 
unsigned getCallSiteBeginLabel (MCSymbol *BeginLabel)
 getCallSiteBeginLabel - Get the call site number for a begin label. More...
 
bool hasCallSiteBeginLabel (MCSymbol *BeginLabel)
 
void setCurrentCallSite (unsigned Site)
 setCurrentCallSite - Set the call site currently being processed. More...
 
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. More...
 
void setVariableDbgInfo (MDNode *N, unsigned Slot, DebugLoc Loc)
 
VariableDbgInfoMapTygetVariableDbgInfo ()
 
- Public Member Functions inherited from llvm::ImmutablePass
virtual void initializePass ()
 
virtual ImmutablePassgetAsImmutablePass ()
 
bool runOnModule (Module &)
 
 ImmutablePass (char &pid)
 
virtual ~ImmutablePass ()
 
- Public Member Functions inherited from llvm::ModulePass
PasscreatePrinterPass (raw_ostream &O, const std::string &Banner) const
 createPrinterPass - Get a module printer pass. More...
 
virtual void assignPassManager (PMStack &PMS, PassManagerType T)
 
virtual PassManagerType getPotentialPassManagerType () const
 Return what kind of Pass Manager can manage this pass. More...
 
 ModulePass (char &pid)
 
virtual ~ModulePass ()
 
- Public Member Functions inherited from llvm::Pass
 Pass (PassKind K, char &pid)
 
virtual ~Pass ()
 
PassKind getPassKind () const
 
virtual const char * getPassName () const
 
AnalysisID getPassID () const
 getPassID - Return the PassID number that corresponds to this pass. More...
 
virtual void print (raw_ostream &O, const Module *M) const
 
void dump () const
 
virtual void preparePassManager (PMStack &)
 Check if available pass managers are suitable for this pass or not. More...
 
void setResolver (AnalysisResolver *AR)
 
AnalysisResolvergetResolver () const
 
virtual void getAnalysisUsage (AnalysisUsage &) const
 
virtual void releaseMemory ()
 
virtual void * getAdjustedAnalysisPointer (AnalysisID ID)
 
virtual PMDataManagergetAsPMDataManager ()
 
virtual void verifyAnalysis () const
 
virtual void dumpPassStructure (unsigned Offset=0)
 
template<typename AnalysisType >
AnalysisType * getAnalysisIfAvailable () const
 
bool mustPreserveAnalysisID (char &AID) const
 
template<typename AnalysisType >
AnalysisType & getAnalysis () const
 
template<typename AnalysisType >
AnalysisType & getAnalysis (Function &F)
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI) const
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI, Function &F)
 

Public Attributes

VariableDbgInfoMapTy VariableDbgInfo
 

Static Public Attributes

static char ID
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::Pass
static const PassInfolookupPassInfo (const void *TI)
 
static const PassInfolookupPassInfo (StringRef Arg)
 
static PasscreatePass (AnalysisID 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 171 of file MachineModuleInfo.h.

Definition at line 173 of file MachineModuleInfo.h.

Constructor & Destructor Documentation

MachineModuleInfo::MachineModuleInfo ( )

Definition at line 260 of file MachineModuleInfo.cpp.

References llvm_unreachable.

MachineModuleInfo::MachineModuleInfo ( const MCAsmInfo MAI,
const MCRegisterInfo MRI,
const MCObjectFileInfo MOFI 
)
MachineModuleInfo::~MachineModuleInfo ( )

Definition at line 267 of file MachineModuleInfo.cpp.

Member Function Documentation

void MachineModuleInfo::addCatchTypeInfo ( MachineBasicBlock LandingPad,
ArrayRef< const GlobalVariable * >  TyInfo 
)

addCatchTypeInfo - Provide the catch typeinfo for a landing pad.

Definition at line 431 of file MachineModuleInfo.cpp.

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

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

void MachineModuleInfo::addCleanup ( MachineBasicBlock LandingPad)

addCleanup - Add a cleanup action for a landing pad.

Definition at line 452 of file MachineModuleInfo.cpp.

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

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

void MachineModuleInfo::addFilterTypeInfo ( MachineBasicBlock LandingPad,
ArrayRef< const GlobalVariable * >  TyInfo 
)

addFilterTypeInfo - Provide the filter typeinfo for a landing pad.

Definition at line 441 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 llvm::MachineModuleInfo::addFrameInst ( const MCCFIInstruction Inst)
inline
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 393 of file MachineModuleInfo.cpp.

References llvm::LandingPadInfo::BeginLabels, llvm::LandingPadInfo::EndLabels, and getOrCreateLandingPadInfo().

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

MCSymbol * MachineModuleInfo::addLandingPad ( MachineBasicBlock LandingPad)

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 402 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 411 of file MachineModuleInfo.cpp.

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

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

void MachineModuleInfo::AnalyzeModule ( const Module M)
bool llvm::MachineModuleInfo::callsEHReturn ( ) const
inline
bool llvm::MachineModuleInfo::callsUnwindInit ( ) const
inline

Definition at line 223 of file MachineModuleInfo.h.

Referenced by llvm::X86FrameLowering::hasFP().

bool MachineModuleInfo::doFinalization ( Module )
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 286 of file MachineModuleInfo.cpp.

References llvm::MCContext::reset().

bool MachineModuleInfo::doInitialization ( Module )
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.

void MachineModuleInfo::EndFunction ( )

EndFunction - Discard function meta information.

Definition at line 303 of file MachineModuleInfo.cpp.

References llvm::SmallVectorImpl< T >::clear(), and VariableDbgInfo.

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

MCSymbol * MachineModuleInfo::getAddrLabelSymbol ( const BasicBlock BB)

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

References llvm::MMIAddrLabelMap::getAddrLabelSymbol().

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

std::vector< MCSymbol * > MachineModuleInfo::getAddrLabelSymbolToEmit ( const BasicBlock BB)

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

References llvm::MMIAddrLabelMap::getAddrLabelSymbolToEmit().

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

unsigned llvm::MachineModuleInfo::getCallSiteBeginLabel ( MCSymbol BeginLabel)
inline

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

Definition at line 364 of file MachineModuleInfo.h.

References hasCallSiteBeginLabel().

Referenced by llvm::DwarfException::ComputeCallSiteTable().

SmallVectorImpl<unsigned>& llvm::MachineModuleInfo::getCallSiteLandingPad ( MCSymbol Sym)
inline

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

Definition at line 346 of file MachineModuleInfo.h.

References hasCallSiteLandingPad().

uint32_t llvm::MachineModuleInfo::getCompactUnwindEncoding ( ) const
inline

getCompactUnwindEncoding - Returns the compact unwind encoding for a function if the target supports the encoding. This encoding replaces a function's CIE and FDE.

Definition at line 248 of file MachineModuleInfo.h.

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

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

Definition at line 191 of file MachineModuleInfo.h.

unsigned llvm::MachineModuleInfo::getCurrentCallSite ( )
inline

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

Definition at line 381 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 521 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 391 of file MachineModuleInfo.h.

Referenced by llvm::DwarfException::ComputeActionsTable(), llvm::DwarfException::EmitExceptionTable(), and llvm::DwarfException::EmitTypeInfos().

const std::vector<MCCFIInstruction>& llvm::MachineModuleInfo::getFrameInstructions ( ) const
inline

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

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

const std::vector<LandingPadInfo>& llvm::MachineModuleInfo::getLandingPads ( ) const
inline

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

Definition at line 336 of file MachineModuleInfo.h.

Referenced by llvm::DwarfCFIException::BeginFunction(), llvm::Win64Exception::BeginFunction(), llvm::DwarfException::EmitExceptionTable(), and llvm::ARMException::EndFunction().

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

Definition at line 207 of file MachineModuleInfo.h.

LandingPadInfo & MachineModuleInfo::getOrCreateLandingPadInfo ( MachineBasicBlock LandingPad)

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

Definition at line 379 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
const Function * MachineModuleInfo::getPersonality ( ) const

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

unsigned MachineModuleInfo::getPersonalityIndex ( ) const

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

Referenced by llvm::DwarfCFIException::BeginFunction(), llvm::Win64Exception::BeginFunction(), llvm::ARMException::EndFunction(), and llvm::Win64Exception::EndFunction().

unsigned MachineModuleInfo::getTypeIDFor ( const GlobalVariable TI)

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

Definition at line 511 of file MachineModuleInfo.cpp.

References N.

Referenced by addCatchTypeInfo(), and addFilterTypeInfo().

const std::vector<const GlobalVariable *>& llvm::MachineModuleInfo::getTypeInfos ( ) const
inline

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

Definition at line 385 of file MachineModuleInfo.h.

Referenced by llvm::DwarfException::EmitExceptionTable(), and llvm::DwarfException::EmitTypeInfos().

VariableDbgInfoMapTy& llvm::MachineModuleInfo::getVariableDbgInfo ( )
inline

Definition at line 405 of file MachineModuleInfo.h.

References VariableDbgInfo.

bool llvm::MachineModuleInfo::hasCallSiteBeginLabel ( MCSymbol BeginLabel)
inline

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

Definition at line 372 of file MachineModuleInfo.h.

Referenced by getCallSiteBeginLabel().

bool llvm::MachineModuleInfo::hasCallSiteLandingPad ( MCSymbol Sym)
inline

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

Definition at line 354 of file MachineModuleInfo.h.

Referenced by getCallSiteLandingPad().

bool llvm::MachineModuleInfo::hasDebugInfo ( ) const
inline
bool llvm::MachineModuleInfo::isUsedFunction ( const Function F) const
inline

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

void llvm::MachineModuleInfo::setCallsEHReturn ( bool  b)
inline

Definition at line 221 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 359 of file MachineModuleInfo.h.

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

void MachineModuleInfo::setCallSiteLandingPad ( MCSymbol Sym,
ArrayRef< unsigned Sites 
)

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

Definition at line 504 of file MachineModuleInfo.cpp.

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

void llvm::MachineModuleInfo::setCallsUnwindInit ( bool  b)
inline

Definition at line 224 of file MachineModuleInfo.h.

void llvm::MachineModuleInfo::setCompactUnwindEncoding ( uint32_t  Enc)
inline

setCompactUnwindEncoding - Set the compact unwind encoding for a function if the target supports the encoding.

Definition at line 252 of file MachineModuleInfo.h.

void llvm::MachineModuleInfo::setCurrentCallSite ( unsigned  Site)
inline

setCurrentCallSite - Set the call site currently being processed.

Definition at line 377 of file MachineModuleInfo.h.

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

void llvm::MachineModuleInfo::setDebugInfoAvailability ( bool  avail)
inline

Definition at line 218 of file MachineModuleInfo.h.

Referenced by llvm::DwarfDebug::beginModule().

void llvm::MachineModuleInfo::setModule ( const Module M)
inline

Definition at line 193 of file MachineModuleInfo.h.

void llvm::MachineModuleInfo::setUsesVAFloatArgument ( bool  b)
inline

Definition at line 230 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 401 of file MachineModuleInfo.h.

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

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

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

void MachineModuleInfo::TidyLandingPads ( DenseMap< MCSymbol *, uintptr_t > *  LPMap = 0)
bool llvm::MachineModuleInfo::usesVAFloatArgument ( ) const
inline

Member Data Documentation

char llvm::MachineModuleInfo::ID
static

Definition at line 169 of file MachineModuleInfo.h.

VariableDbgInfoMapTy llvm::MachineModuleInfo::VariableDbgInfo

Definition at line 174 of file MachineModuleInfo.h.

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


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