Most of bugpoint now only needs to know the pass names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110534 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index bbdc728..4e63e16 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -99,13 +99,6 @@
return Result;
}
-static const PassInfo *getPI(Pass *P) {
- const void *ID = P->getPassID();
- const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(ID);
- delete P;
- return PI;
-}
-
/// performFinalCleanups - This method clones the current Program and performs
/// a series of cleanups intended to get rid of extra cruft on the module
/// before handing it to the user.
@@ -115,15 +108,15 @@
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
I->setLinkage(GlobalValue::ExternalLinkage);
- std::vector<const PassInfo*> CleanupPasses;
- CleanupPasses.push_back(getPI(createGlobalDCEPass()));
+ std::vector<std::string> CleanupPasses;
+ CleanupPasses.push_back("globaldce");
if (MayModifySemantics)
- CleanupPasses.push_back(getPI(createDeadArgHackingPass()));
+ CleanupPasses.push_back("deadarghaX0r");
else
- CleanupPasses.push_back(getPI(createDeadArgEliminationPass()));
+ CleanupPasses.push_back("deadargelim");
- CleanupPasses.push_back(getPI(createDeadTypeEliminationPass()));
+ CleanupPasses.push_back("deadtypeelim");
Module *New = runPassesOn(M, CleanupPasses);
if (New == 0) {
@@ -139,8 +132,8 @@
/// function. This returns null if there are no extractable loops in the
/// program or if the loop extractor crashes.
Module *BugDriver::ExtractLoop(Module *M) {
- std::vector<const PassInfo*> LoopExtractPasses;
- LoopExtractPasses.push_back(getPI(createSingleLoopExtractorPass()));
+ std::vector<std::string> LoopExtractPasses;
+ LoopExtractPasses.push_back("loop-extract-single");
Module *NewM = runPassesOn(M, LoopExtractPasses);
if (NewM == 0) {
@@ -354,8 +347,8 @@
std::string uniqueFN = "--extract-blocks-file=" + uniqueFilename.str();
const char *ExtraArg = uniqueFN.c_str();
- std::vector<const PassInfo*> PI;
- PI.push_back(getPI(createBlockExtractorPass()));
+ std::vector<std::string> PI;
+ PI.push_back("extract-blocks");
Module *Ret = runPassesOn(M, PI, false, 1, &ExtraArg);
uniqueFilename.eraseFromDisk(); // Free disk space