summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/CodeGeneratorBug.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-01 16:14:33 +0000
committerChris Lattner <sabre@nondot.org>2003-08-01 16:14:33 +0000
commit335c51afdf3269c348b5d2471ee85f0eca95040c (patch)
treeac4d6e79c8213bd55feddd9b73322e12b66485f7 /llvm/tools/bugpoint/CodeGeneratorBug.cpp
parentf7e125403bcbc2216fdc20eb70f659cafee89061 (diff)
downloadbcm5719-llvm-335c51afdf3269c348b5d2471ee85f0eca95040c.tar.gz
bcm5719-llvm-335c51afdf3269c348b5d2471ee85f0eca95040c.zip
Don't emit modules with lots of cruft hanging off of them.
llvm-svn: 7478
Diffstat (limited to 'llvm/tools/bugpoint/CodeGeneratorBug.cpp')
-rw-r--r--llvm/tools/bugpoint/CodeGeneratorBug.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/CodeGeneratorBug.cpp b/llvm/tools/bugpoint/CodeGeneratorBug.cpp
index 02ef5e3459a..bc557e7bc75 100644
--- a/llvm/tools/bugpoint/CodeGeneratorBug.cpp
+++ b/llvm/tools/bugpoint/CodeGeneratorBug.cpp
@@ -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";
typedef Module::iterator MI;
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
std::string SafeModuleBC = getUniqueFilename("bugpoint.safe.bc");
- if (verifyModule(*SafeModule)) {
- std::cerr << "Bytecode file corrupted!\n";
- exit(1);
- }
+
if (BD.writeProgramToFile(SafeModuleBC, SafeModule)) {
std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting.";
exit(1);
OpenPOWER on IntegriCloud