From 208eecd57fd7f2b2072f70f8fe81f1f5dd68267a Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Wed, 13 Sep 2017 17:03:37 +0000 Subject: Convenience/safety fix for llvm::sys::Execute(And|No)Wait Summary: Change the type of the Redirects parameter of llvm::sys::ExecuteAndWait, ExecuteNoWait and other APIs that wrap them from `const StringRef **` to `ArrayRef>`, which is safer and simplifies the use of these APIs (no more local StringRef variables just to get a pointer to). Corresponding clang changes will be posted as a separate patch. Reviewers: bkramer Reviewed By: bkramer Subscribers: vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D37563 llvm-svn: 313155 --- llvm/lib/Support/Signals.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'llvm/lib/Support/Signals.cpp') diff --git a/llvm/lib/Support/Signals.cpp b/llvm/lib/Support/Signals.cpp index 256a22dee87..661f4d649cd 100644 --- a/llvm/lib/Support/Signals.cpp +++ b/llvm/lib/Support/Signals.cpp @@ -123,11 +123,7 @@ static bool printSymbolizedStackTrace(StringRef Argv0, } } - StringRef InputFileStr(InputFile); - StringRef OutputFileStr(OutputFile); - StringRef StderrFileStr; - const StringRef *Redirects[] = {&InputFileStr, &OutputFileStr, - &StderrFileStr}; + Optional Redirects[] = {InputFile.str(), OutputFile.str(), llvm::None}; const char *Args[] = {"llvm-symbolizer", "--functions=linkage", "--inlining", #ifdef LLVM_ON_WIN32 // Pass --relative-address on Windows so that we don't -- cgit v1.2.3