diff options
author | Alexander Kornienko <alexfh@google.com> | 2017-09-13 17:03:37 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2017-09-13 17:03:37 +0000 |
commit | 208eecd57fd7f2b2072f70f8fe81f1f5dd68267a (patch) | |
tree | 54617190d336acb1f3cc7764bb91d9b785abfd25 /llvm/lib/Support/Signals.cpp | |
parent | f6c74c472d00467e9007dfffb26278ec053957aa (diff) | |
download | bcm5719-llvm-208eecd57fd7f2b2072f70f8fe81f1f5dd68267a.tar.gz bcm5719-llvm-208eecd57fd7f2b2072f70f8fe81f1f5dd68267a.zip |
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<Optional<StringRef>>`, 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
Diffstat (limited to 'llvm/lib/Support/Signals.cpp')
-rw-r--r-- | llvm/lib/Support/Signals.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
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<StringRef> 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 |