mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user