mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 07:24:47 +00:00
Don't emit modules with lots of cruft hanging off of them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7478 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -167,6 +167,15 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (verifyModule(*SafeModule) || verifyModule(*TestModule)) {
|
||||||
|
std::cerr << "Bugpoint has a bug, an corrupted a module!!\n";
|
||||||
|
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;
|
||||||
@@ -185,10 +194,7 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs,
|
|||||||
|
|
||||||
// Write out the bytecode to be sent to CBE
|
// Write out the bytecode to be sent to CBE
|
||||||
std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc");
|
std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc");
|
||||||
if (verifyModule(*SafeModule)) {
|
|
||||||
std::cerr << "Bytecode file corrupted!\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
if (BD.writeProgramToFile(SafeModuleBC, SafeModule)) {
|
if (BD.writeProgramToFile(SafeModuleBC, SafeModule)) {
|
||||||
std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting.";
|
std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting.";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Reference in New Issue
Block a user