/// emit common EH frames.
std::vector<const Function *> Personalities;
- /// UsedFunctions - The functions in the @llvm.used list in a more easily
- /// searchable format. This does not include the functions in
- /// llvm.compiler.used.
- SmallPtrSet<const Function *, 32> UsedFunctions;
-
/// AddrLabelSymbols - This map keeps track of which symbol is being used for
/// the specified basic block's address of label.
MMIAddrLabelMap *AddrLabelSymbols;
return const_cast<MachineModuleInfo*>(this)->getObjFileInfo<Ty>();
}
- /// AnalyzeModule - Scan the module for global debug information.
- ///
- void AnalyzeModule(const Module &M);
-
/// hasDebugInfo - Returns true if valid debug info is present.
///
bool hasDebugInfo() const { return DbgInfoAvailable; }
return Personalities;
}
- /// 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.
- bool isUsedFunction(const Function *F) const {
- return UsedFunctions.count(F);
- }
-
/// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.
///
void addCatchTypeInfo(MachineBasicBlock *LandingPad,
bool AsmPrinter::doInitialization(Module &M) {
MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- MMI->AnalyzeModule(M);
// Initialize TargetLoweringObjectFile.
const_cast<TargetLoweringObjectFile&>(getObjFileLowering())
VariableDbgInfos.clear();
}
-/// AnalyzeModule - Scan the module for global debug information.
-///
-void MachineModuleInfo::AnalyzeModule(const Module &M) {
- // Insert functions in the llvm.used array (but not llvm.compiler.used) into
- // UsedFunctions.
- const GlobalVariable *GV = M.getGlobalVariable("llvm.used");
- if (!GV || !GV->hasInitializer()) return;
-
- // Should be an array of 'i8*'.
- const ConstantArray *InitList = cast<ConstantArray>(GV->getInitializer());
-
- for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i)
- if (const Function *F =
- dyn_cast<Function>(InitList->getOperand(i)->stripPointerCasts()))
- UsedFunctions.insert(F);
-}
-
//===- Address of Block Management ----------------------------------------===//