//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
class CGPassManager : public ModulePass, public PMDataManager {
public:
- static const int ID;
- CGPassManager(int Depth)
+ static char ID;
+ explicit CGPassManager(int Depth)
: ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
/// run - Execute all of the passes scheduled for execution. Keep track of
}
};
-const int CGPassManager::ID = 0;
+char CGPassManager::ID = 0;
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the module, and if so, return true.
bool CGPassManager::runOnModule(Module &M) {
for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
Function *F = SCC[i]->getFunction();
if (F) {
- dumpPassInfo(P, EXECUTION_MSG, ON_FUNCTION_MSG, F->getName());
+ dumpPassInfo(P, EXECUTION_MSG, ON_FUNCTION_MSG, F->getNameStart());
Changed |= FPP->runOnFunction(*F);
}
}
if (Changed)
dumpPassInfo(P, MODIFICATION_MSG, ON_CG_MSG, "");
dumpAnalysisSetInfo("Preserved", P, AnUsage.getPreservedSet());
-
+
+ verifyPreservedAnalysis(P);
removeNotPreservedAnalysis(P);
recordAvailableAnalysis(P);
removeDeadPasses(P, "", ON_CG_MSG);
void CallGraphSCCPass::assignPassManager(PMStack &PMS,
PassManagerType PreferredType) {
// Find CGPassManager
- while (!PMS.empty()) {
- if (PMS.top()->getPassManagerType() > PMT_CallGraphPassManager)
- PMS.pop();
- else;
- break;
- }
+ while (!PMS.empty() &&
+ PMS.top()->getPassManagerType() > PMT_CallGraphPassManager)
+ PMS.pop();
CGPassManager *CGP = dynamic_cast<CGPassManager *>(PMS.top());
// [3] Assign manager to manage this new manager. This may create
// and push new managers into PMS
Pass *P = dynamic_cast<Pass *>(CGP);
- P->assignPassManager(PMS);
+ TPM->schedulePass(P);
// [4] Push new manager into PMS
PMS.push(CGP);