mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Add a -t="dir" option to the driver. This can be used to specify the directory to be used as TempDir if somebody doesn't want to use the standard /tmp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75121 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
549882d312
commit
0b8f418488
@ -22,6 +22,7 @@ namespace SaveTempsEnum { enum Values { Cwd, Obj, Unset }; }
|
||||
|
||||
extern llvm::cl::list<std::string> InputFilenames;
|
||||
extern llvm::cl::opt<std::string> OutputFilename;
|
||||
extern llvm::cl::opt<std::string> TempDirname;
|
||||
extern llvm::cl::list<std::string> Languages;
|
||||
extern llvm::cl::opt<bool> DryRun;
|
||||
extern llvm::cl::opt<bool> VerboseMode;
|
||||
|
@ -25,6 +25,8 @@ cl::list<std::string> InputFilenames(cl::Positional, cl::desc("<input file>"),
|
||||
cl::ZeroOrMore);
|
||||
cl::opt<std::string> OutputFilename("o", cl::desc("Output file name"),
|
||||
cl::value_desc("file"), cl::Prefix);
|
||||
cl::opt<std::string> TempDirname("t", cl::desc("Temp dir name"),
|
||||
cl::value_desc("dir"), cl::Prefix);
|
||||
cl::list<std::string> Languages("x",
|
||||
cl::desc("Specify the language of the following input files"),
|
||||
cl::ZeroOrMore);
|
||||
|
@ -31,6 +31,15 @@ namespace {
|
||||
sys::Path getTempDir() {
|
||||
sys::Path tempDir;
|
||||
|
||||
if (! TempDirname.empty() {
|
||||
tempDir = TempDirname;
|
||||
if (!tempDir.exists()) {
|
||||
std::string ErrMsg;
|
||||
if (tempDir.createDirectoryOnDisk(true, &ErrMsg))
|
||||
throw std::runtime_error(ErrMsg);
|
||||
}
|
||||
}
|
||||
|
||||
// GCC 4.5-style -save-temps handling.
|
||||
if (SaveTemps == SaveTempsEnum::Unset) {
|
||||
tempDir = sys::Path::GetTemporaryDirectory();
|
||||
|
Loading…
x
Reference in New Issue
Block a user