New flag causes crash reports to be written in the specified directory
rather than the temp directory.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang/lib/Driver/Driver.cpp | ||
---|---|---|
4043–4044 ↗ | (On Diff #152933) | Maybe you can combine these into one line with: SmallString<128> CrashDirectory{ A->getValue() }; |
clang/test/Driver/crash-diagnostics-dir.c | ||
5 ↗ | (On Diff #152933) | This will fail on Windows I think where path separators are backslashes. I think you need to do something like: {{.*}}Output{{/|\\}}crash-diagnostics-dir.c.tmp{{(/|\\).*}}.c |
llvm/include/llvm/Support/FileSystem.h | ||
758–759 ↗ | (On Diff #152933) | Is there any reason we can't just use the existing overload? In other words, instead of creating this overload and having the user write createUniqueFile("foo", "bar"), how about just createUniqueFile("foo-%%%%%%.bar") which seems equivalent. |
clang/lib/Driver/Driver.cpp | ||
---|---|---|
4043–4044 ↗ | (On Diff #152933) | Or even simpler, SmallString<128> CrashDirectory = A->getValue(); :-) |
clang/test/Driver/crash-diagnostics-dir.c | ||
1 ↗ | (On Diff #152933) | The other test/Driver/crash-report-* tests do "rm -rf %t" before creating the directory. Since you're using "-p" with mkdir below, it won't fail if the dir exists, but removing the dir before is still nice since it will clean up temporary files from previous test runs. Without it, a new file will be added to the dir each time the test is run, so it will grow in size over time. |