#include <algorithm>
#include <vector>
#include <map>
+using namespace llvm;
// See PassManagers.h for Pass Manager infrastructure overview.
public:
static char ID;
- BBPassManager(int Depth)
+ explicit BBPassManager(int Depth)
: PMDataManager(Depth), FunctionPass((intptr_t)&ID) {}
/// Execute all of the passes scheduled for execution. Keep track of
public PMTopLevelManager {
public:
static char ID;
- FunctionPassManagerImpl(int Depth) :
+ explicit FunctionPassManagerImpl(int Depth) :
Pass((intptr_t)&ID), PMDataManager(Depth),
PMTopLevelManager(TLM_Function) { }
public:
static char ID;
- MPPassManager(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth) { }
+ explicit MPPassManager(int Depth) :
+ Pass((intptr_t)&ID), PMDataManager(Depth) { }
// Delete on the fly managers.
virtual ~MPPassManager() {
public:
static char ID;
- PassManagerImpl(int Depth) : Pass((intptr_t)&ID), PMDataManager(Depth),
- PMTopLevelManager(TLM_Pass) { }
+ explicit PassManagerImpl(int Depth) :
+ Pass((intptr_t)&ID), PMDataManager(Depth),
+ PMTopLevelManager(TLM_Pass) { }
/// add - Add a pass to the queue of passes to run. This passes ownership of
/// the Pass to the PassManager. When the PassManager is destroyed, the pass
}
/// Remove analysis passes that are not used any longer
-void PMDataManager::removeDeadPasses(Pass *P, const std::string &Msg,
+void PMDataManager::removeDeadPasses(Pass *P, const char *Msg,
enum PassDebuggingString DBG_STR) {
SmallVector<Pass *, 12> DeadPasses;
void PMDataManager::dumpPassInfo(Pass *P, enum PassDebuggingString S1,
enum PassDebuggingString S2,
- const std::string &Msg) {
+ const char *Msg) {
if (PassDebugging < Executions)
return;
cerr << (void*)this << std::string(getDepth()*2+1, ' ');
AnalysisUsage AnUsage;
BP->getAnalysisUsage(AnUsage);
- dumpPassInfo(BP, EXECUTION_MSG, ON_BASICBLOCK_MSG, (*I).getName());
+ dumpPassInfo(BP, EXECUTION_MSG, ON_BASICBLOCK_MSG, I->getNameStart());
dumpAnalysisSetInfo("Required", BP, AnUsage.getRequiredSet());
initializeAnalysisImpl(BP);
if (TheTimeInfo) TheTimeInfo->passEnded(BP);
if (Changed)
- dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, (*I).getName());
+ dumpPassInfo(BP, MODIFICATION_MSG, ON_BASICBLOCK_MSG, I->getNameStart());
dumpAnalysisSetInfo("Preserved", BP, AnUsage.getPreservedSet());
verifyPreservedAnalysis(BP);
removeNotPreservedAnalysis(BP);
recordAvailableAnalysis(BP);
- removeDeadPasses(BP, (*I).getName(), ON_BASICBLOCK_MSG);
-
+ removeDeadPasses(BP, I->getNameStart(), ON_BASICBLOCK_MSG);
}
+
return Changed |= doFinalization(F);
}
AnalysisUsage AnUsage;
FP->getAnalysisUsage(AnUsage);
- dumpPassInfo(FP, EXECUTION_MSG, ON_FUNCTION_MSG, F.getName());
+ dumpPassInfo(FP, EXECUTION_MSG, ON_FUNCTION_MSG, F.getNameStart());
dumpAnalysisSetInfo("Required", FP, AnUsage.getRequiredSet());
initializeAnalysisImpl(FP);
if (TheTimeInfo) TheTimeInfo->passEnded(FP);
if (Changed)
- dumpPassInfo(FP, MODIFICATION_MSG, ON_FUNCTION_MSG, F.getName());
+ dumpPassInfo(FP, MODIFICATION_MSG, ON_FUNCTION_MSG, F.getNameStart());
dumpAnalysisSetInfo("Preserved", FP, AnUsage.getPreservedSet());
verifyPreservedAnalysis(FP);
removeNotPreservedAnalysis(FP);
recordAvailableAnalysis(FP);
- removeDeadPasses(FP, F.getName(), ON_FUNCTION_MSG);
+ removeDeadPasses(FP, F.getNameStart(), ON_FUNCTION_MSG);
}
return Changed;
}
AnalysisUsage AnUsage;
MP->getAnalysisUsage(AnUsage);
- dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, M.getModuleIdentifier());
+ dumpPassInfo(MP, EXECUTION_MSG, ON_MODULE_MSG, M.getModuleIdentifier().c_str());
dumpAnalysisSetInfo("Required", MP, AnUsage.getRequiredSet());
initializeAnalysisImpl(MP);
if (TheTimeInfo) TheTimeInfo->passEnded(MP);
if (Changed)
- dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG,
- M.getModuleIdentifier());
+ dumpPassInfo(MP, MODIFICATION_MSG, ON_MODULE_MSG, M.getModuleIdentifier().c_str());
dumpAnalysisSetInfo("Preserved", MP, AnUsage.getPreservedSet());
verifyPreservedAnalysis(MP);
removeNotPreservedAnalysis(MP);
recordAvailableAnalysis(MP);
- removeDeadPasses(MP, M.getModuleIdentifier(), ON_MODULE_MSG);
+ removeDeadPasses(MP, M.getModuleIdentifier().c_str(), ON_MODULE_MSG);
}
return Changed;
}
for(std::deque<PMDataManager *>::iterator I = S.begin(),
E = S.end(); I != E; ++I) {
Pass *P = dynamic_cast<Pass *>(*I);
- printf ("%s ", P->getPassName());
+ printf("%s ", P->getPassName());
}
if (!S.empty())
- printf ("\n");
+ printf("\n");
}
/// Find appropriate Module Pass Manager in the PM Stack and
// Basic Pass Manager is a leaf pass manager. It does not handle
// any other pass manager.
- if (!PMS.empty()) {
+ if (!PMS.empty())
BBP = dynamic_cast<BBPassManager *>(PMS.top());
- }
// If leaf manager is not Basic Block Pass manager then create new
// basic Block Pass manager.