31 #ifndef LLVM_CODEGEN_MACHINEMODULEINFO_H
32 #define LLVM_CODEGEN_MACHINEMODULEINFO_H
42 #include "llvm/Support/DataTypes.h"
54 class MMIAddrLabelMap;
55 class MachineBasicBlock;
56 class MachineFunction;
87 typedef std::vector<std::pair<MCSymbol*, StubValueTy> >
SymbolListTy;
111 std::vector<MCCFIInstruction> FrameInstructions;
115 uint32_t CompactUnwindEncoding;
119 std::vector<LandingPadInfo> LandingPads;
131 unsigned CurCallSite;
134 std::vector<const GlobalVariable *> TypeInfos;
137 std::vector<unsigned> FilterIds;
141 std::vector<unsigned> FilterEnds;
145 std::vector<const Function *> Personalities;
157 bool CallsUnwindInit;
161 bool DbgInfoAvailable;
166 bool UsesVAFloatArgument;
199 template<
typename Ty>
202 ObjFileMMI =
new Ty(*
this);
203 return *
static_cast<Ty*
>(ObjFileMMI);
206 template<
typename Ty>
227 return UsesVAFloatArgument;
231 UsesVAFloatArgument = b;
238 return FrameInstructions;
242 FrameInstructions.push_back(Inst);
269 std::vector<MCSymbol*> &Result);
298 return Personalities;
305 return UsedFunctions.count(F);
348 "missing call site number for landing pad!");
349 return LPadToCallSiteMap[Sym];
355 return !LPadToCallSiteMap[Sym].empty();
360 CallSiteMap[BeginLabel] = Site;
366 "Missing call site number for EH_LABEL!");
367 return CallSiteMap[BeginLabel];
373 return CallSiteMap[BeginLabel] != 0;
const Ty & getObjFileInfo() const
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
void push_back(const T &Elt)
std::vector< MCSymbol * > getAddrLabelSymbolToEmit(const BasicBlock *BB)
uint32_t getCompactUnwindEncoding() const
static SymbolListTy GetSortedStubs(const DenseMap< MCSymbol *, StubValueTy > &)
The main container class for the LLVM Intermediate Representation.
std::pair< unsigned, DebugLoc > UnsignedDebugLocPair
void setCallSiteLandingPad(MCSymbol *Sym, ArrayRef< unsigned > Sites)
const std::vector< const GlobalVariable * > & getTypeInfos() const
const Function * Personality
unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel)
getCallSiteBeginLabel - Get the call site number for a begin label.
MDNode - a tuple of other values.
MCSymbol * LandingPadLabel
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
MCSymbol * getAddrLabelSymbol(const BasicBlock *BB)
virtual bool doFinalization(Module &)
void setCurrentCallSite(unsigned Site)
setCurrentCallSite - Set the call site currently being processed.
SmallVector< MCSymbol *, 1 > BeginLabels
void takeDeletedSymbolsForFunction(const Function *F, std::vector< MCSymbol * > &Result)
bool callsUnwindInit() const
const std::vector< unsigned > & getFilterIds() const
const Module * getModule() const
void TidyLandingPads(DenseMap< MCSymbol *, uintptr_t > *LPMap=0)
bool hasDebugInfo() const
bool usesVAFloatArgument() const
void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site)
setCallSiteBeginLabel - Map the begin label for a call site.
bool hasCallSiteLandingPad(MCSymbol *Sym)
LandingPadInfo & getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad)
unsigned getCurrentCallSite()
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.
void addPersonality(MachineBasicBlock *LandingPad, const Function *Personality)
bool hasCallSiteBeginLabel(MCSymbol *BeginLabel)
void AnalyzeModule(const Module &M)
void setCallsEHReturn(bool b)
LLVM Basic Block Representation.
VariableDbgInfoMapTy & getVariableDbgInfo()
SmallVector< MCSymbol *, 1 > EndLabels
SmallVector< std::pair< TrackingVH< MDNode >, UnsignedDebugLocPair >, 4 > VariableDbgInfoMapTy
const std::vector< const Function * > & getPersonalities() const
getPersonalities - Return array of personality functions ever seen.
void setCompactUnwindEncoding(uint32_t Enc)
std::vector< int > TypeIds
MCSymbol * addLandingPad(MachineBasicBlock *LandingPad)
void addInvoke(MachineBasicBlock *LandingPad, MCSymbol *BeginLabel, MCSymbol *EndLabel)
unsigned getTypeIDFor(const GlobalVariable *TI)
bool callsEHReturn() const
SmallVectorImpl< unsigned > & getCallSiteLandingPad(MCSymbol *Sym)
void setDebugInfoAvailability(bool avail)
const MCContext & getContext() const
void setCallsUnwindInit(bool b)
void addCatchTypeInfo(MachineBasicBlock *LandingPad, ArrayRef< const GlobalVariable * > TyInfo)
void addCleanup(MachineBasicBlock *LandingPad)
VariableDbgInfoMapTy VariableDbgInfo
MachineBasicBlock * LandingPadBlock
const std::vector< LandingPadInfo > & getLandingPads() const
LandingPadInfo(MachineBasicBlock *MBB)
void setModule(const Module *M)
int getFilterIDFor(std::vector< unsigned > &TyIds)
void setUsesVAFloatArgument(bool b)
unsigned getPersonalityIndex() const
void addFrameInst(const MCCFIInstruction &Inst)
bool isUsedFunction(const Function *F) const
void setVariableDbgInfo(MDNode *N, unsigned Slot, DebugLoc Loc)
void addFilterTypeInfo(MachineBasicBlock *LandingPad, ArrayRef< const GlobalVariable * > TyInfo)
virtual bool doInitialization(Module &)
const MCRegisterInfo & MRI
virtual ~MachineModuleInfoImpl()
const Function * getPersonality() const
getPersonality - Return the personality function for the current function.