NFC. Making printOptionValues an API on the parser class.
[oota-llvm.git] / lib / Support / GraphWriter.cpp
index e68ee434dd592557d0d44ca84191ee80cedf04ea..054df528474e8b442713b575a3d69c3e2c2fd77f 100644 (file)
@@ -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;