summaryrefslogtreecommitdiffstats
path: root/lib/Support/GraphWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/GraphWriter.cpp')
-rw-r--r--lib/Support/GraphWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Support/GraphWriter.cpp b/lib/Support/GraphWriter.cpp
index e68ee43..054df52 100644
--- a/lib/Support/GraphWriter.cpp
+++ b/lib/Support/GraphWriter.cpp
@@ -105,9 +105,10 @@ struct GraphSession {
SmallVector<StringRef, 8> parts;
Names.split(parts, "|");
for (auto Name : parts) {
- ProgramPath = sys::FindProgramByName(Name);
- if (!ProgramPath.empty())
+ if (ErrorOr<std::string> P = sys::findProgramByName(Name)) {
+ ProgramPath = *P;
return true;
+ }
Log << " Tried '" << Name << "'\n";
}
return false;