[PATCH] D48601: Added -fcrash-diagnostics-dir flag

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 27 02:16:03 PDT 2018


hans added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:4043-4044
+    if (CCGenDiagnostics && A) {
+      SmallString<128> CrashDirectory;
+      CrashDirectory = A->getValue();
+      llvm::sys::path::append(CrashDirectory, Split.first);
----------------
zturner wrote:
> Maybe you can combine these into one line with:
> 
> ```
> SmallString<128> CrashDirectory{ A->getValue() };
> ```
Or even simpler,

```
SmallString<128> CrashDirectory = A->getValue();
```

:-)


================
Comment at: clang/test/Driver/crash-diagnostics-dir.c:1
+// RUN: mkdir -p %t
+// RUN: not %clang -fcrash-diagnostics-dir=%t -c %s 2>&1 | FileCheck %s
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D48601





More information about the cfe-commits mailing list