summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/GraphWriter.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2017-09-13 17:03:37 +0000
committerAlexander Kornienko <alexfh@google.com>2017-09-13 17:03:37 +0000
commit208eecd57fd7f2b2072f70f8fe81f1f5dd68267a (patch)
tree54617190d336acb1f3cc7764bb91d9b785abfd25 /llvm/lib/Support/GraphWriter.cpp
parentf6c74c472d00467e9007dfffb26278ec053957aa (diff)
downloadbcm5719-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/GraphWriter.cpp')
-rw-r--r--llvm/lib/Support/GraphWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/GraphWriter.cpp b/llvm/lib/Support/GraphWriter.cpp
index e04bd8bb3b9..fd7fab08278 100644
--- a/llvm/lib/Support/GraphWriter.cpp
+++ b/llvm/lib/Support/GraphWriter.cpp
@@ -96,7 +96,7 @@ static bool ExecGraphViewer(StringRef ExecPath, std::vector<const char *> &args,
std::string &ErrMsg) {
assert(args.back() == nullptr);
if (wait) {
- if (sys::ExecuteAndWait(ExecPath, args.data(), nullptr, nullptr, 0, 0,
+ if (sys::ExecuteAndWait(ExecPath, args.data(), nullptr, {}, 0, 0,
&ErrMsg)) {
errs() << "Error: " << ErrMsg << "\n";
return true;
@@ -104,7 +104,7 @@ static bool ExecGraphViewer(StringRef ExecPath, std::vector<const char *> &args,
sys::fs::remove(Filename);
errs() << " done. \n";
} else {
- sys::ExecuteNoWait(ExecPath, args.data(), nullptr, nullptr, 0, &ErrMsg);
+ sys::ExecuteNoWait(ExecPath, args.data(), nullptr, {}, 0, &ErrMsg);
errs() << "Remember to erase graph file: " << Filename << "\n";
}
return false;
OpenPOWER on IntegriCloud