summaryrefslogtreecommitdiff
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-06-21 02:17:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-06-21 02:17:36 +0000
commitbc2ed599e877b9d76bd548546019f98ae256fe9b (patch)
treeadfdf09a9ab79275cf5927bde964bcc94f52e090 /tools/bugpoint
parentf0efafa61e2002b1b21df23376687eb14252a355 (diff)
downloadllvm-bc2ed599e877b9d76bd548546019f98ae256fe9b.tar.gz
llvm-bc2ed599e877b9d76bd548546019f98ae256fe9b.tar.bz2
llvm-bc2ed599e877b9d76bd548546019f98ae256fe9b.tar.xz
Save more temps with -save-temps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/Miscompilation.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp
index 7094390464..b2581d1a46 100644
--- a/tools/bugpoint/Miscompilation.cpp
+++ b/tools/bugpoint/Miscompilation.cpp
@@ -894,6 +894,8 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe,
}
delete Test;
+ FileRemover TestModuleBCRemover(TestModuleBC, !SaveTemps);
+
// Make the shared library
sys::Path SafeModuleBC("bugpoint.safe.bc");
if (SafeModuleBC.makeUnique(true, &ErrMsg)) {
@@ -907,11 +909,16 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe,
<< "'\nExiting.";
exit(1);
}
+
+ FileRemover SafeModuleBCRemover(SafeModuleBC, !SaveTemps);
+
std::string SharedObject = BD.compileSharedObject(SafeModuleBC.str(), Error);
if (!Error.empty())
return false;
delete Safe;
+ FileRemover SharedObjectRemover(sys::Path(SharedObject), !SaveTemps);
+
// Run the code generator on the `Test' code, loading the shared library.
// The function returns whether or not the new output differs from reference.
bool Result = BD.diffProgram(TestModuleBC.str(), SharedObject, false, &Error);
@@ -922,9 +929,6 @@ static bool TestCodeGenerator(BugDriver &BD, Module *Test, Module *Safe,
errs() << ": still failing!\n";
else
errs() << ": didn't fail.\n";
- TestModuleBC.eraseFromDisk();
- SafeModuleBC.eraseFromDisk();
- sys::Path(SharedObject).eraseFromDisk();
return Result;
}