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
This commit is contained in:
Chris Lattner
2004-11-16 06:31:38 +00:00
parent 8bf7fba10b
commit 90c18c5c69
3 changed files with 41 additions and 22 deletions
+10 -1
View File
@@ -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;