[PATCH] [RFC] Use llvm-symbolizer to symbolize LLVM/Clang crash dumps
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);
> 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 = &InputFile;
> Redirects = &OutputFile;
> StringRef StderrFile;
> Redirects = &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.
More information about the llvm-commits