LLVM API Documentation

llvm::MachineModuleInfo Class Reference

#include <MachineModuleInfo.h>

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

List of all members.

Public Member Functions

 MachineModuleInfo ()
 ~MachineModuleInfo ()
bool doInitialization ()
bool doFinalization ()
void BeginFunction (MachineFunction *MF)
void EndFunction ()
void AnalyzeModule (Module &M)
bool hasDebugInfo () const
void setDebugInfoAvailability (bool avail)
bool callsEHReturn () const
void setCallsEHReturn (bool b)
bool callsUnwindInit () const
void setCallsUnwindInit (bool b)
unsigned NextLabelID ()
void InvalidateLabel (unsigned LabelID)
void RemapLabel (unsigned OldLabelID, unsigned NewLabelID)
unsigned MappedLabel (unsigned LabelID) const
bool isDbgLabelUsed (unsigned LabelID)
void RecordUsedDbgLabel (unsigned LabelID)
std::vector< MachineMove > & getFrameMoves ()
LandingPadInfo & getOrCreateLandingPadInfo (MachineBasicBlock *LandingPad)
void addInvoke (MachineBasicBlock *LandingPad, unsigned BeginLabel, unsigned EndLabel)
unsigned addLandingPad (MachineBasicBlock *LandingPad)
void addPersonality (MachineBasicBlock *LandingPad, Function *Personality)
unsigned getPersonalityIndex () const
const std::vector< Function * > & getPersonalities () const
 getPersonalities - Return array of personality functions ever seen.
bool isUsedFunction (const Function *F)
void addCatchTypeInfo (MachineBasicBlock *LandingPad, std::vector< GlobalVariable * > &TyInfo)
void addFilterTypeInfo (MachineBasicBlock *LandingPad, std::vector< GlobalVariable * > &TyInfo)
void addCleanup (MachineBasicBlock *LandingPad)
unsigned getTypeIDFor (GlobalVariable *TI)
int getFilterIDFor (std::vector< unsigned > &TyIds)
void TidyLandingPads ()
const std::vector
< LandingPadInfo > & 
getLandingPads () const
const std::vector
< GlobalVariable * > & 
getTypeInfos () const
const std::vector< unsigned > & getFilterIds () const
Function * getPersonality () const
 getPersonality - Return the personality function for the current function.

Static Public Attributes

static char ID = 0


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


Constructor & Destructor Documentation

MachineModuleInfo::MachineModuleInfo (  ) 

Definition at line 38 of file MachineModuleInfo.cpp.

MachineModuleInfo::~MachineModuleInfo (  ) 

Definition at line 51 of file MachineModuleInfo.cpp.


Member Function Documentation

bool MachineModuleInfo::doInitialization (  ) 

doInitialization - Initialize the state for a new module.

Definition at line 57 of file MachineModuleInfo.cpp.

bool MachineModuleInfo::doFinalization (  ) 

doFinalization - Tear down the state after completion of a module.

Definition at line 63 of file MachineModuleInfo.cpp.

void MachineModuleInfo::BeginFunction ( MachineFunction *  MF  ) 

BeginFunction - Begin gathering function meta information.

Definition at line 69 of file MachineModuleInfo.cpp.

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

void MachineModuleInfo::EndFunction (  ) 

EndFunction - Discard function meta information.

Definition at line 75 of file MachineModuleInfo.cpp.

Referenced by llvm::DwarfWriter::EndFunction().

void MachineModuleInfo::AnalyzeModule ( Module &  M  ) 

bool llvm::MachineModuleInfo::hasDebugInfo (  )  const [inline]

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

Definition at line 158 of file MachineModuleInfo.h.

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

bool llvm::MachineModuleInfo::callsEHReturn (  )  const [inline]

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

Definition at line 161 of file MachineModuleInfo.h.

bool llvm::MachineModuleInfo::callsUnwindInit (  )  const [inline]

Definition at line 163 of file MachineModuleInfo.h.

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

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

Definition at line 164 of file MachineModuleInfo.h.

unsigned llvm::MachineModuleInfo::NextLabelID (  )  [inline]

void llvm::MachineModuleInfo::InvalidateLabel ( unsigned  LabelID  )  [inline]

InvalidateLabel - Inhibit use of the specified label # from MachineModuleInfo, for example because the code was deleted.

Definition at line 176 of file MachineModuleInfo.h.

References RemapLabel().

void llvm::MachineModuleInfo::RemapLabel ( unsigned  OldLabelID,
unsigned  NewLabelID 
) [inline]

RemapLabel - Indicate that a label has been merged into another.

Definition at line 183 of file MachineModuleInfo.h.

Referenced by InvalidateLabel(), and llvm::DebugLabelFolder::runOnMachineFunction().

unsigned llvm::MachineModuleInfo::MappedLabel ( unsigned  LabelID  )  const [inline]

MappedLabel - Find out the label's final ID. Zero indicates deletion. ID != Mapped ID indicates that the label was folded into another label.

Definition at line 193 of file MachineModuleInfo.h.

Referenced by llvm::Dwarf::EmitFrameMoves(), and TidyLandingPads().

bool llvm::MachineModuleInfo::isDbgLabelUsed ( unsigned  LabelID  )  [inline]

isDbgLabelUsed - Return true if label with LabelID is used by DwarfWriter.

Definition at line 200 of file MachineModuleInfo.h.

References llvm::SmallSet< T, N >::count().

Referenced by llvm::DebugLabelFolder::runOnMachineFunction().

void llvm::MachineModuleInfo::RecordUsedDbgLabel ( unsigned  LabelID  )  [inline]

RecordUsedDbgLabel - Mark label with LabelID as used. This is used by DwarfWriter to inform DebugLabelFolder that certain labels are not to be deleted.

Definition at line 207 of file MachineModuleInfo.h.

References llvm::SmallSet< T, N >::insert().

Referenced by llvm::DwarfDebug::RecordInlinedFnEnd(), and llvm::DwarfDebug::RecordInlinedFnStart().

std::vector<MachineMove>& llvm::MachineModuleInfo::getFrameMoves (  )  [inline]

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

Definition at line 214 of file MachineModuleInfo.h.

Referenced by llvm::X86RegisterInfo::emitCalleeSavedFrameMoves(), llvm::XCoreRegisterInfo::emitPrologue(), llvm::SPURegisterInfo::emitPrologue(), llvm::PPCRegisterInfo::emitPrologue(), llvm::DwarfException::EndFunction(), and llvm::DwarfDebug::EndFunction().

LandingPadInfo & MachineModuleInfo::getOrCreateLandingPadInfo ( MachineBasicBlock *  LandingPad  ) 

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

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

Definition at line 111 of file MachineModuleInfo.cpp.

References llvm::LandingPadInfo::LandingPadBlock.

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

void MachineModuleInfo::addInvoke ( MachineBasicBlock *  LandingPad,
unsigned  BeginLabel,
unsigned  EndLabel 
)

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

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

Definition at line 125 of file MachineModuleInfo.cpp.

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

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

References getOrCreateLandingPadInfo(), llvm::LandingPadInfo::LandingPadLabel, and NextLabelID().

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

addPersonality - Provide the personality function for the exception information.

addPersonality - Provide the personality function for the exception information.

Definition at line 143 of file MachineModuleInfo.cpp.

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

Referenced by llvm::AddCatchInfo().

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

Referenced by llvm::JITDwarfEmitter::EmitDwarfTable(), llvm::DwarfException::EndFunction(), and llvm::JITDwarfEmitter::GetDwarfTableSizeInBytes().

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

getPersonalities - Return array of personality functions ever seen.

Definition at line 240 of file MachineModuleInfo.h.

Referenced by llvm::X86ATTAsmPrinter::doFinalization(), llvm::JITDwarfEmitter::EmitDwarfTable(), llvm::DwarfException::EndModule(), and llvm::JITDwarfEmitter::GetDwarfTableSizeInBytes().

bool llvm::MachineModuleInfo::isUsedFunction ( const Function *  F  )  [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 247 of file MachineModuleInfo.h.

void MachineModuleInfo::addCatchTypeInfo ( MachineBasicBlock *  LandingPad,
std::vector< GlobalVariable * > &  TyInfo 
)

addCatchTypeInfo - Provide the catch typeinfo for a landing pad.

Definition at line 162 of file MachineModuleInfo.cpp.

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

Referenced by llvm::AddCatchInfo().

void MachineModuleInfo::addFilterTypeInfo ( MachineBasicBlock *  LandingPad,
std::vector< GlobalVariable * > &  TyInfo 
)

addFilterTypeInfo - Provide the filter typeinfo for a landing pad.

Definition at line 171 of file MachineModuleInfo.cpp.

References E, getFilterIDFor(), getOrCreateLandingPadInfo(), getTypeIDFor(), and llvm::LandingPadInfo::TypeIds.

Referenced by llvm::AddCatchInfo().

void MachineModuleInfo::addCleanup ( MachineBasicBlock *  LandingPad  ) 

addCleanup - Add a cleanup action for a landing pad.

Definition at line 182 of file MachineModuleInfo.cpp.

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

Referenced by llvm::AddCatchInfo().

unsigned MachineModuleInfo::getTypeIDFor ( GlobalVariable *  TI  ) 

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

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

Definition at line 234 of file MachineModuleInfo.cpp.

Referenced by addCatchTypeInfo(), and addFilterTypeInfo().

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

References E.

Referenced by addFilterTypeInfo().

void MachineModuleInfo::TidyLandingPads (  ) 

TidyLandingPads - Remap landing pad labels and remove any deleted landing pads.

TidyLandingPads - Remap landing pad labels and remove any deleted landing pads.

Definition at line 189 of file MachineModuleInfo.cpp.

References llvm::SmallVectorImpl< T >::begin(), BeginLabel, llvm::LandingPadInfo::BeginLabels, EndLabel, llvm::LandingPadInfo::EndLabels, llvm::SmallVectorImpl< T >::erase(), llvm::LandingPadInfo::LandingPadBlock, llvm::LandingPadInfo::LandingPadLabel, MappedLabel(), and llvm::LandingPadInfo::TypeIds.

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

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

Referenced by llvm::DwarfException::BeginFunction(), and llvm::DwarfException::EndFunction().

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

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

Definition at line 285 of file MachineModuleInfo.h.

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

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


Member Data Documentation

char MachineModuleInfo::ID = 0 [static]

Definition at line 130 of file MachineModuleInfo.h.

Referenced by NextLabelID().


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