From a603569515eea06e54e6e041b1c690d33086f375 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 12 Jun 2013 20:44:26 +0000 Subject: [PATCH] Use the global functions instead of the Program methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183861 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Compilation.cpp | 8 +++----- lib/Driver/Driver.cpp | 5 ++--- lib/Frontend/CompilerInstance.cpp | 2 +- lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 4 ++-- tools/driver/driver.cpp | 2 +- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp index 1bff4a3d7a..bc1a75a44a 100644 --- a/lib/Driver/Compilation.cpp +++ b/lib/Driver/Compilation.cpp @@ -291,11 +291,9 @@ int Compilation::ExecuteCommand(const Command &C, std::string Error; bool ExecutionFailed; - int Res = - llvm::sys::Program::ExecuteAndWait(Prog, Argv, - /*env*/0, Redirects, - /*secondsToWait*/0, /*memoryLimit*/0, - &Error, &ExecutionFailed); + int Res = llvm::sys::ExecuteAndWait(Prog, Argv, /*env*/ 0, Redirects, + /*secondsToWait*/ 0, /*memoryLimit*/ 0, + &Error, &ExecutionFailed); if (!Error.empty()) { assert(Res && "Error string set with 0 result code!"); getDriver().Diag(clang::diag::err_drv_command_failure) << Error; diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 5e8dde353b..937a676a3d 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -1599,12 +1599,11 @@ std::string Driver::GetProgramPath(const char *Name, } // If all else failed, search the path. - llvm::sys::Path - P(llvm::sys::Program::FindProgramByName(TargetSpecificExecutable)); + llvm::sys::Path P(llvm::sys::FindProgramByName(TargetSpecificExecutable)); if (!P.empty()) return P.str(); - P = llvm::sys::Path(llvm::sys::Program::FindProgramByName(Name)); + P = llvm::sys::Path(llvm::sys::FindProgramByName(Name)); if (!P.empty()) return P.str(); diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index b4bb6f3251..648466d4dc 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -384,7 +384,7 @@ void CompilerInstance::createCodeCompletionConsumer() { } if (CompletionConsumer->isOutputBinary() && - llvm::sys::Program::ChangeStdoutToBinary()) { + llvm::sys::ChangeStdoutToBinary()) { getPreprocessor().getDiagnostics().Report(diag::err_fe_stdout_binary); setCodeCompletionConsumer(0); } diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index d71e528848..d67d603960 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -769,13 +769,13 @@ UbigraphViz::~UbigraphViz() { Out.reset(0); llvm::errs() << "Running 'ubiviz' program... "; std::string ErrMsg; - llvm::sys::Path Ubiviz = llvm::sys::Program::FindProgramByName("ubiviz"); + llvm::sys::Path Ubiviz = llvm::sys::FindProgramByName("ubiviz"); std::vector args; args.push_back(Ubiviz.c_str()); args.push_back(Filename.c_str()); args.push_back(0); - if (llvm::sys::Program::ExecuteAndWait(Ubiviz, &args[0],0,0,0,0,&ErrMsg)) { + if (llvm::sys::ExecuteAndWait(Ubiviz, &args[0],0,0,0,0,&ErrMsg)) { llvm::errs() << "Error viewing graph: " << ErrMsg << "\n"; } diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index 4c40da3080..b3c301cefd 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -434,7 +434,7 @@ int main(int argc_, const char **argv_) { // Do a PATH lookup, if there are no directory components. if (llvm::sys::path::filename(InstalledPath) == InstalledPath) { - llvm::sys::Path Tmp = llvm::sys::Program::FindProgramByName( + llvm::sys::Path Tmp = llvm::sys::FindProgramByName( llvm::sys::path::filename(InstalledPath.str())); if (!Tmp.empty()) InstalledPath = Tmp.str(); -- 2.40.0