mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Add save-temps option to bugpoint to keep temporary stuff.
Patch by Sandeep Patel git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78183 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0802a1e1e8
commit
86c006a971
@ -196,7 +196,7 @@ bool BugDriver::run() {
|
|||||||
// Make sure the reference output file gets deleted on exit from this
|
// Make sure the reference output file gets deleted on exit from this
|
||||||
// function, if appropriate.
|
// function, if appropriate.
|
||||||
sys::Path ROF(ReferenceOutputFile);
|
sys::Path ROF(ReferenceOutputFile);
|
||||||
FileRemover RemoverInstance(ROF, CreatedOutput);
|
FileRemover RemoverInstance(ROF, CreatedOutput && !SaveTemps);
|
||||||
|
|
||||||
// Diff the output of the raw program against the reference output. If it
|
// Diff the output of the raw program against the reference output. If it
|
||||||
// matches, then we assume there is a miscompilation bug and try to
|
// matches, then we assume there is a miscompilation bug and try to
|
||||||
|
@ -288,7 +288,7 @@ void BugDriver::compileProgram(Module *M) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove the temporary bitcode file when we are done.
|
// Remove the temporary bitcode file when we are done.
|
||||||
FileRemover BitcodeFileRemover(BitcodeFile);
|
FileRemover BitcodeFileRemover(BitcodeFile, !SaveTemps);
|
||||||
|
|
||||||
// Actually compile the program!
|
// Actually compile the program!
|
||||||
Interpreter->compileProgram(BitcodeFile.toString());
|
Interpreter->compileProgram(BitcodeFile.toString());
|
||||||
@ -328,7 +328,7 @@ std::string BugDriver::executeProgram(std::string OutputFile,
|
|||||||
|
|
||||||
// Remove the temporary bitcode file when we are done.
|
// Remove the temporary bitcode file when we are done.
|
||||||
sys::Path BitcodePath (BitcodeFile);
|
sys::Path BitcodePath (BitcodeFile);
|
||||||
FileRemover BitcodeFileRemover(BitcodePath, CreatedBitcode);
|
FileRemover BitcodeFileRemover(BitcodePath, CreatedBitcode && !SaveTemps);
|
||||||
|
|
||||||
if (OutputFile.empty()) OutputFile = "bugpoint-execution-output";
|
if (OutputFile.empty()) OutputFile = "bugpoint-execution-output";
|
||||||
|
|
||||||
|
@ -22,6 +22,11 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
|
namespace llvm {
|
||||||
|
cl::opt<bool>
|
||||||
|
SaveTemps("save-temps", cl::init(false), cl::desc("Save temporary files"));
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
cl::opt<std::string>
|
cl::opt<std::string>
|
||||||
RemoteClient("remote-client",
|
RemoteClient("remote-client",
|
||||||
@ -395,7 +400,7 @@ int LLC::ExecuteProgram(const std::string &Bitcode,
|
|||||||
|
|
||||||
sys::Path OutputAsmFile;
|
sys::Path OutputAsmFile;
|
||||||
OutputCode(Bitcode, OutputAsmFile);
|
OutputCode(Bitcode, OutputAsmFile);
|
||||||
FileRemover OutFileRemover(OutputAsmFile);
|
FileRemover OutFileRemover(OutputAsmFile, !SaveTemps);
|
||||||
|
|
||||||
std::vector<std::string> GCCArgs(ArgsForGCC);
|
std::vector<std::string> GCCArgs(ArgsForGCC);
|
||||||
GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
|
GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
|
||||||
@ -560,7 +565,7 @@ int CBE::ExecuteProgram(const std::string &Bitcode,
|
|||||||
sys::Path OutputCFile;
|
sys::Path OutputCFile;
|
||||||
OutputCode(Bitcode, OutputCFile);
|
OutputCode(Bitcode, OutputCFile);
|
||||||
|
|
||||||
FileRemover CFileRemove(OutputCFile);
|
FileRemover CFileRemove(OutputCFile, !SaveTemps);
|
||||||
|
|
||||||
std::vector<std::string> GCCArgs(ArgsForGCC);
|
std::vector<std::string> GCCArgs(ArgsForGCC);
|
||||||
GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
|
GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end());
|
||||||
@ -726,7 +731,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
|
|||||||
errs() << "\n";
|
errs() << "\n";
|
||||||
);
|
);
|
||||||
|
|
||||||
FileRemover OutputBinaryRemover(OutputBinary);
|
FileRemover OutputBinaryRemover(OutputBinary, !SaveTemps);
|
||||||
|
|
||||||
if (RemoteClientPath.isEmpty()) {
|
if (RemoteClientPath.isEmpty()) {
|
||||||
DEBUG(errs() << "<run locally>";);
|
DEBUG(errs() << "<run locally>";);
|
||||||
|
@ -17,12 +17,15 @@
|
|||||||
#ifndef BUGPOINT_TOOLRUNNER_H
|
#ifndef BUGPOINT_TOOLRUNNER_H
|
||||||
#define BUGPOINT_TOOLRUNNER_H
|
#define BUGPOINT_TOOLRUNNER_H
|
||||||
|
|
||||||
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
|
extern cl::opt<bool> SaveTemps;
|
||||||
|
|
||||||
class CBE;
|
class CBE;
|
||||||
class LLC;
|
class LLC;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user