[PATCH] [RFC] Use llvm-symbolizer to symbolize LLVM/Clang crash dumps

David Blaikie dblaikie at gmail.com
Fri Oct 3 16:45:16 PDT 2014


================
Comment at: lib/Support/Unix/Signals.inc:331
@@ +330,3 @@
+  std::vector<const StringRef *> Redirects(3, nullptr);
+  auto InputFileStr = llvm::make_unique<const StringRef>(InputFile);
+  auto OutputFileStr = llvm::make_unique<const StringRef>(OutputFile);
----------------
samsonov wrote:
> dblaikie wrote:
> > Could these just be straight StringRefs, rather than unique_ptr<StringRef>?
> sys::ExecuteAndWait accepts (const StringRef ** as its arguments). That's sort of... ugly. It also distinguishes between nullptr (= redirect is not set up) and empty StringRef (= redirect to /dev/null).
Not sure I follow... What I mean is to change this code to:

  std::vector<const StringRef *> Redirects(3, nullptr);
  Redirects[0] = &InputFile;
  Redirects[1] = &OutputFile;
  StringRef StderrFile;
  Redirects[2] = &StderrFile;

Would that be wrong somehow?

http://reviews.llvm.org/D5610






More information about the llvm-commits mailing list