/// BBPassManager manages BasicBlockPass. It batches all the
/// pass together and sequence them to process one basic block before
/// processing next basic block.
-class VISIBILITY_HIDDEN BBPassManager : public PMDataManager,
- public FunctionPass {
+class BBPassManager : public PMDataManager, public FunctionPass {
public:
static char ID;
static ManagedStatic<sys::SmartMutex<true> > TimingInfoMutex;
-class VISIBILITY_HIDDEN TimingInfo {
+class TimingInfo {
std::map<Pass*, Timer> TimingData;
TimerGroup TG;
std::map<AnalysisID, Pass *>::iterator Info = I++;
if (!dynamic_cast<ImmutablePass*>(Info->second) &&
std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
- PreservedSet.end())
+ PreservedSet.end()) {
// Remove this analysis
+ if (PassDebugging >= Details) {
+ Pass *S = Info->second;
+ errs() << " -- '" << P->getPassName() << "' is not preserving '";
+ errs() << S->getPassName() << "'\n";
+ }
InheritedAnalysis[Index]->erase(Info);
+ }
}
}
}
/// Remove analysis passes that are not used any longer
-void PMDataManager::removeDeadPasses(Pass *P, const StringRef &Msg,
+void PMDataManager::removeDeadPasses(Pass *P, StringRef Msg,
enum PassDebuggingString DBG_STR) {
SmallVector<Pass *, 12> DeadPasses;
freePass(*I, Msg, DBG_STR);
}
-void PMDataManager::freePass(Pass *P, const StringRef &Msg,
+void PMDataManager::freePass(Pass *P, StringRef Msg,
enum PassDebuggingString DBG_STR) {
dumpPassInfo(P, FREEING_MSG, DBG_STR, Msg);
void PMDataManager::dumpPassInfo(Pass *P, enum PassDebuggingString S1,
enum PassDebuggingString S2,
- const StringRef &Msg) {
+ StringRef Msg) {
if (PassDebugging < Executions)
return;
errs() << (void*)this << std::string(getDepth()*2+1, ' ');
dumpAnalysisUsage("Preserved", P, analysisUsage.getPreservedSet());
}
-void PMDataManager::dumpAnalysisUsage(const StringRef &Msg, const Pass *P,
+void PMDataManager::dumpAnalysisUsage(StringRef Msg, const Pass *P,
const AnalysisUsage::VectorType &Set) const {
assert(PassDebugging >= Details);
if (Set.empty())
bool FunctionPassManagerImpl::doInitialization(Module &M) {
bool Changed = false;
+ dumpArguments();
+ dumpPasses();
+
for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index)
Changed |= getContainedManager(Index)->doInitialization(M);
bool Changed = false;
TimingInfo::createTheTimeInfo();
- dumpArguments();
- dumpPasses();
-
initializeAllAnalysisInfo();
for (unsigned Index = 0; Index < getNumContainedManagers(); ++Index)
Changed |= getContainedManager(Index)->runOnFunction(F);
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
ModulePass *MP = getContainedPass(Index);
- dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG,
- M.getModuleIdentifier().c_str());
+ dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, M.getModuleIdentifier());
dumpRequiredSet(MP);
initializeAnalysisImpl(MP);
if (Changed)
dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG,
- M.getModuleIdentifier().c_str());
+ M.getModuleIdentifier());
dumpPreservedSet(MP);
verifyPreservedAnalysis(MP);
removeNotPreservedAnalysis(MP);
recordAvailableAnalysis(MP);
- removeDeadPasses(MP, M.getModuleIdentifier().c_str(), ON_MODULE_MSG);
+ removeDeadPasses(MP, M.getModuleIdentifier(), ON_MODULE_MSG);
}
// Finalize on-the-fly passes