- // 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;
DEBUG(std::cerr << "Safe module:\n";
typedef Module::iterator MI;
typedef Module::giterator MGI;
- // 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.
// 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.
std::cerr << "Bytecode file corrupted!\n";
exit(1);
}
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);
}
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;
delete SafeModule;
delete TestModule;