diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-03 22:29:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-03 22:29:43 +0000 |
commit | 4089d880ff385f9ee5acbb7ee1e9a09dd913230d (patch) | |
tree | 7c3f12ebb1aa2a36c4631310931c5f9e83c17000 /llvm/tools/bugpoint/CodeGeneratorBug.cpp | |
parent | 6b0869be4b688d77d3623a2a7e478248af4d7201 (diff) | |
download | bcm5719-llvm-4089d880ff385f9ee5acbb7ee1e9a09dd913230d.tar.gz bcm5719-llvm-4089d880ff385f9ee5acbb7ee1e9a09dd913230d.zip |
Fix problem I introduced in bugpoint with the cleanup functions
llvm-svn: 7549
Diffstat (limited to 'llvm/tools/bugpoint/CodeGeneratorBug.cpp')
-rw-r--r-- | llvm/tools/bugpoint/CodeGeneratorBug.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/llvm/tools/bugpoint/CodeGeneratorBug.cpp b/llvm/tools/bugpoint/CodeGeneratorBug.cpp index 10e2186df28..2e2e532ec9a 100644 --- a/llvm/tools/bugpoint/CodeGeneratorBug.cpp +++ b/llvm/tools/bugpoint/CodeGeneratorBug.cpp @@ -172,10 +172,6 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs, 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; @@ -200,10 +196,6 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs, 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 // Funcs. We know which ones these are because they are non-external in // ToOptimize, but external in ToNotOptimize. @@ -222,11 +214,20 @@ bool ReduceMisCodegenFunctions::TestFuncs(const std::vector<Function*> &Funcs, std::cerr << "Bytecode file corrupted!\n"; 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)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; exit(1); } + // Make a shared library + std::string SharedObject; + BD.compileSharedObject(SafeModuleBC, SharedObject); + delete SafeModule; delete TestModule; |