The BlockExtractorPass() constructor was not reading the BlockFile and that was
authorRafael Espindola <rafael.espindola@gmail.com>
Sat, 31 Jul 2010 00:32:17 +0000 (00:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sat, 31 Jul 2010 00:32:17 +0000 (00:32 +0000)
exactly what bugpoint expected it to do.

There was also only one user of
BlockExtractorPass(const std::vector<BasicBlock*> &B), so just remove it and
make BlockExtractorPass read BlockFile.

This fixes bugpoint's block extraction.

Nick, please review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109936 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/IPO.h
lib/Transforms/IPO/LoopExtractor.cpp
tools/bugpoint/ExtractFunction.cpp

index 8fb4b63c64638f4a316ed7d40046322ee637cd92..fc67bc594bdcb431368b078b9d8b0f40efb0a130 100644 (file)
@@ -181,7 +181,7 @@ Pass *createSingleLoopExtractorPass();
 /// createBlockExtractorPass - This pass extracts all blocks (except those
 /// specified in the argument list) from the functions in the module.
 ///
-ModulePass *createBlockExtractorPass(const std::vector<BasicBlock*> &BTNE);
+ModulePass *createBlockExtractorPass();
 
 /// createStripDeadPrototypesPass - This pass removes any function declarations
 /// (prototypes) that are not used.
index fa8eb5e9fb2b65b7545460f684f2b8c24bb088f7..fd60adfc507d33510dc553427089622d3b02cbca 100644 (file)
@@ -147,12 +147,10 @@ namespace {
     std::vector<std::pair<std::string, std::string> > BlocksToNotExtractByName;
   public:
     static char ID; // Pass identification, replacement for typeid
-    explicit BlockExtractorPass(const std::vector<BasicBlock*> &B) 
-      : ModulePass(&ID), BlocksToNotExtract(B) {
+    BlockExtractorPass() : ModulePass(&ID) {
       if (!BlockFile.empty())
         LoadFile(BlockFile.c_str());
     }
-    BlockExtractorPass() : ModulePass(&ID) {}
 
     bool runOnModule(Module &M);
   };
@@ -166,9 +164,9 @@ INITIALIZE_PASS(BlockExtractorPass, "extract-blocks",
 // createBlockExtractorPass - This pass extracts all blocks (except those
 // specified in the argument list) from the functions in the module.
 //
-ModulePass *llvm::createBlockExtractorPass(const std::vector<BasicBlock*> &BTNE)
+ModulePass *llvm::createBlockExtractorPass()
 {
-  return new BlockExtractorPass(BTNE);
+  return new BlockExtractorPass();
 }
 
 void BlockExtractorPass::LoadFile(const char *Filename) {
index e0f9db6d438bdb3c10f940e652c91cf65eceeb9d..6913fd06a938ee2122734d5d96c0a6e0d22fa81a 100644 (file)
@@ -354,8 +354,7 @@ Module *BugDriver::ExtractMappedBlocksFromModule(const
   const char *ExtraArg = uniqueFN.c_str();
 
   std::vector<const PassInfo*> PI;
-  std::vector<BasicBlock *> EmptyBBs; // This parameter is ignored.
-  PI.push_back(getPI(createBlockExtractorPass(EmptyBBs)));
+  PI.push_back(getPI(createBlockExtractorPass()));
   Module *Ret = runPassesOn(M, PI, false, 1, &ExtraArg);
 
   uniqueFilename.eraseFromDisk(); // Free disk space