mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Fix problem I introduced in bugpoint with the cleanup functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7549 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -172,10 +172,6 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up the modules, removing extra cruft that we don't need anymore...
|
|
||||||
SafeModule = BD.performFinalCleanups(SafeModule);
|
|
||||||
TestModule = BD.performFinalCleanups(TestModule);
|
|
||||||
|
|
||||||
DEBUG(std::cerr << "Safe module:\n";
|
DEBUG(std::cerr << "Safe module:\n";
|
||||||
typedef Module::iterator MI;
|
typedef Module::iterator MI;
|
||||||
typedef Module::giterator MGI;
|
typedef Module::giterator MGI;
|
||||||
@ -200,10 +196,6 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make a shared library
|
|
||||||
std::string SharedObject;
|
|
||||||
BD.compileSharedObject(SafeModuleBC, SharedObject);
|
|
||||||
|
|
||||||
// Remove all functions from the Test module EXCEPT for the ones specified in
|
// Remove all functions from the Test module EXCEPT for the ones specified in
|
||||||
// Funcs. We know which ones these are because they are non-external in
|
// Funcs. We know which ones these are because they are non-external in
|
||||||
// ToOptimize, but external in ToNotOptimize.
|
// ToOptimize, but external in ToNotOptimize.
|
||||||
@ -222,11 +214,20 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
|||||||
std::cerr << "Bytecode file corrupted!\n";
|
std::cerr << "Bytecode file corrupted!\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean up the modules, removing extra cruft that we don't need anymore...
|
||||||
|
SafeModule = BD.performFinalCleanups(SafeModule);
|
||||||
|
TestModule = BD.performFinalCleanups(TestModule);
|
||||||
|
|
||||||
if (BD.writeProgramToFile(TestModuleBC, TestModule)) {
|
if (BD.writeProgramToFile(TestModuleBC, TestModule)) {
|
||||||
std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting.";
|
std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting.";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make a shared library
|
||||||
|
std::string SharedObject;
|
||||||
|
BD.compileSharedObject(SafeModuleBC, SharedObject);
|
||||||
|
|
||||||
delete SafeModule;
|
delete SafeModule;
|
||||||
delete TestModule;
|
delete TestModule;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user