diff options
Diffstat (limited to 'tools/bugpoint/Miscompilation.cpp')
-rw-r--r-- | tools/bugpoint/Miscompilation.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 0fe14e3..7660a83 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -776,7 +776,12 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe) { CleanupAndPrepareModules(BD, Test, Safe); sys::Path TestModuleBC("bugpoint.test.bc"); - TestModuleBC.makeUnique(); + std::string ErrMsg; + if (TestModuleBC.makeUnique(true, &ErrMsg)) { + std::cerr << BD.getToolName() << "Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } if (BD.writeProgramToFile(TestModuleBC.toString(), Test)) { std::cerr << "Error writing bytecode to `" << TestModuleBC << "'\nExiting."; exit(1); @@ -785,7 +790,11 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe) { // Make the shared library sys::Path SafeModuleBC("bugpoint.safe.bc"); - SafeModuleBC.makeUnique(); + if (SafeModuleBC.makeUnique(true, &ErrMsg)) { + std::cerr << BD.getToolName() << "Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } if (BD.writeProgramToFile(SafeModuleBC.toString(), Safe)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; @@ -836,7 +845,12 @@ bool BugDriver::debugCodeGenerator() { CleanupAndPrepareModules(*this, ToCodeGen, ToNotCodeGen); sys::Path TestModuleBC("bugpoint.test.bc"); - TestModuleBC.makeUnique(); + std::string ErrMsg; + if (TestModuleBC.makeUnique(true, &ErrMsg)) { + std::cerr << getToolName() << "Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } if (writeProgramToFile(TestModuleBC.toString(), ToCodeGen)) { std::cerr << "Error writing bytecode to `" << TestModuleBC << "'\nExiting."; @@ -846,7 +860,11 @@ bool BugDriver::debugCodeGenerator() { // Make the shared library sys::Path SafeModuleBC("bugpoint.safe.bc"); - SafeModuleBC.makeUnique(); + if (SafeModuleBC.makeUnique(true, &ErrMsg)) { + std::cerr << getToolName() << "Error making unique filename: " + << ErrMsg << "\n"; + exit(1); + } if (writeProgramToFile(SafeModuleBC.toString(), ToNotCodeGen)) { std::cerr << "Error writing bytecode to `" << SafeModuleBC << "'\nExiting."; |