aboutsummaryrefslogtreecommitdiff
path: root/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-16 06:31:38 +0000
committerChris Lattner <sabre@nondot.org>2004-11-16 06:31:38 +0000
commit90c18c5c69d9c451e5fdca1e4b4b95e8ed13291a (patch)
treed9da08a621f44bf027cd25f377cbf57d540b824c /tools/bugpoint/ExtractFunction.cpp
parent8bf7fba10b60834d6edfa8d4666edd8cb73b043c (diff)
Make this code not depend on LinkModules leaving the second argument unmolested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--tools/bugpoint/ExtractFunction.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index d65736a1ea..bc38751048 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -143,9 +143,18 @@ Module *BugDriver::ExtractLoop(Module *M) {
// Check to see if we created any new functions. If not, no loops were
// extracted and we should return null.
- if (M->size() == NewM->size()) {
+ static unsigned NumExtracted = 15;
+
+ if (M->size() == NewM->size() || --NumExtracted == 0) {
delete NewM;
return 0;
+ } else {
+ assert(M->size() < NewM->size() && "Loop extract removed functions?");
+ Module::iterator MI = NewM->begin();
+ for (unsigned i = 0, e = M->size(); i != e; ++i)
+ ++MI;
+ for (; MI != NewM->end(); ++MI)
+ std::cerr << "NEW FUNCTION: " << *MI;
}
return NewM;