summaryrefslogtreecommitdiff
path: root/tools
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
commit10b9fa89a1330d950faf3645b13233f0c0553343 (patch)
tree5768cf3fa22dc7ec0a09614651713b7772ce33f4 /tools
parent587a6ce4b99346b5e785d0a5c360c6c6687b036a (diff)
downloadllvm-10b9fa89a1330d950faf3645b13233f0c0553343.tar.gz
llvm-10b9fa89a1330d950faf3645b13233f0c0553343.tar.bz2
llvm-10b9fa89a1330d950faf3645b13233f0c0553343.tar.xz
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
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/CodeGeneratorBug.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/bugpoint/CodeGeneratorBug.cpp b/tools/bugpoint/CodeGeneratorBug.cpp
index 02ef5e3459..bc557e7bc7 100644
--- a/tools/bugpoint/CodeGeneratorBug.cpp
+++ b/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);