[Driver] Create non-existent directory for -fcrash-diagnostics-dir
When user specifies non-existent directory to -fcrash-diagnostics-dir, create it rather than failing with an error as would be the case before. Differential Revision: https://reviews.llvm.org/D61542 llvm-svn: 359954
This commit is contained in:
parent
3c7688bd57
commit
1e393064fa
|
@ -4263,6 +4263,8 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
|
|||
Arg *A = C.getArgs().getLastArg(options::OPT_fcrash_diagnostics_dir);
|
||||
if (CCGenDiagnostics && A) {
|
||||
SmallString<128> CrashDirectory(A->getValue());
|
||||
if (!getVFS().exists(CrashDirectory))
|
||||
llvm::sys::fs::create_directories(CrashDirectory);
|
||||
llvm::sys::path::append(CrashDirectory, Split.first);
|
||||
const char *Middle = Suffix ? "-%%%%%%." : "-%%%%%%";
|
||||
std::error_code EC = llvm::sys::fs::createUniqueFile(
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// RUN: rm -rf %t
|
||||
// RUN: mkdir -p %t
|
||||
// RUN: not %clang -fcrash-diagnostics-dir=%t -c %s -o - 2>&1 | FileCheck %s
|
||||
#pragma clang __debug parser_crash
|
||||
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
|
||||
|
|
Loading…
Reference in New Issue