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

Alexey Samsonov vonosmas at gmail.com
Fri Oct 3 17:09:09 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);
----------------
dblaikie wrote:
> 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?
Ah, sure. I'd still need local variables for StringRef's, as InputFile/OutputFile are SmallStrings, but unique_ptr are not needed here.

http://reviews.llvm.org/D5610






More information about the llvm-commits mailing list