From 35d402fbbaaa7b9db1b56757fb1b390a3889ebad Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Thu, 7 Aug 2003 21:33:33 +0000 Subject: [PATCH] Remove references to `bugpoint' from the now-generic system utilities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7693 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/Support/SystemUtils.h | 11 ++++++----- include/llvm/Support/SystemUtils.h | 11 ++++++----- lib/Support/SystemUtils.cpp | 15 ++++++++------- support/lib/Support/SystemUtils.cpp | 15 ++++++++------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/include/Support/SystemUtils.h b/include/Support/SystemUtils.h index 7321cb54fc1..4573e27ce02 100644 --- a/include/Support/SystemUtils.h +++ b/include/Support/SystemUtils.h @@ -15,12 +15,13 @@ /// bool isExecutableFile(const std::string &ExeFileName); -// FindExecutable - Find a named executable, giving the argv[0] of bugpoint. -// This assumes the executable is in the same directory as bugpoint itself. -// If the executable cannot be found, return an empty string. -// +/// FindExecutable - Find a named executable, giving the argv[0] of program +/// being executed. This allows us to find another LLVM tool if it is built into +/// the same directory, but that directory is neither the current directory, nor +/// in the PATH. If the executable cannot be found, return an empty string. +/// std::string FindExecutable(const std::string &ExeName, - const std::string &BugPointPath); + const std::string &ProgramPath); /// RunProgramWithTimeout - This function executes the specified program, with /// the specified null-terminated argument array, with the stdin/out/err fd's diff --git a/include/llvm/Support/SystemUtils.h b/include/llvm/Support/SystemUtils.h index 7321cb54fc1..4573e27ce02 100644 --- a/include/llvm/Support/SystemUtils.h +++ b/include/llvm/Support/SystemUtils.h @@ -15,12 +15,13 @@ /// bool isExecutableFile(const std::string &ExeFileName); -// FindExecutable - Find a named executable, giving the argv[0] of bugpoint. -// This assumes the executable is in the same directory as bugpoint itself. -// If the executable cannot be found, return an empty string. -// +/// FindExecutable - Find a named executable, giving the argv[0] of program +/// being executed. This allows us to find another LLVM tool if it is built into +/// the same directory, but that directory is neither the current directory, nor +/// in the PATH. If the executable cannot be found, return an empty string. +/// std::string FindExecutable(const std::string &ExeName, - const std::string &BugPointPath); + const std::string &ProgramPath); /// RunProgramWithTimeout - This function executes the specified program, with /// the specified null-terminated argument array, with the stdin/out/err fd's diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp index b23888e2b05..b18a8d50b4d 100644 --- a/lib/Support/SystemUtils.cpp +++ b/lib/Support/SystemUtils.cpp @@ -37,17 +37,18 @@ bool isExecutableFile(const std::string &ExeFileName) { } -// FindExecutable - Find a named executable, giving the argv[0] of bugpoint. -// This assumes the executable is in the same directory as bugpoint itself. -// If the executable cannot be found, return an empty string. +// FindExecutable - Find a named executable, giving the argv[0] of program being +// executed. This allows us to find another LLVM tool if it is built into the +// same directory, but that directory is neither the current directory, nor in +// the PATH. If the executable cannot be found, return an empty string. // std::string FindExecutable(const std::string &ExeName, - const std::string &BugPointPath) { + const std::string &ProgramPath) { // First check the directory that bugpoint is in. We can do this if // BugPointPath contains at least one / character, indicating that it is a // relative path to bugpoint itself. // - std::string Result = BugPointPath; + std::string Result = ProgramPath; while (!Result.empty() && Result[Result.size()-1] != '/') Result.erase(Result.size()-1, 1); @@ -56,8 +57,8 @@ std::string FindExecutable(const std::string &ExeName, if (isExecutableFile(Result)) return Result; // Found it? } - // Okay, if the path to bugpoint didn't tell us anything, try using the PATH - // environment variable. + // Okay, if the path to the program didn't tell us anything, try using the + // PATH environment variable. const char *PathStr = getenv("PATH"); if (PathStr == 0) return ""; diff --git a/support/lib/Support/SystemUtils.cpp b/support/lib/Support/SystemUtils.cpp index b23888e2b05..b18a8d50b4d 100644 --- a/support/lib/Support/SystemUtils.cpp +++ b/support/lib/Support/SystemUtils.cpp @@ -37,17 +37,18 @@ bool isExecutableFile(const std::string &ExeFileName) { } -// FindExecutable - Find a named executable, giving the argv[0] of bugpoint. -// This assumes the executable is in the same directory as bugpoint itself. -// If the executable cannot be found, return an empty string. +// FindExecutable - Find a named executable, giving the argv[0] of program being +// executed. This allows us to find another LLVM tool if it is built into the +// same directory, but that directory is neither the current directory, nor in +// the PATH. If the executable cannot be found, return an empty string. // std::string FindExecutable(const std::string &ExeName, - const std::string &BugPointPath) { + const std::string &ProgramPath) { // First check the directory that bugpoint is in. We can do this if // BugPointPath contains at least one / character, indicating that it is a // relative path to bugpoint itself. // - std::string Result = BugPointPath; + std::string Result = ProgramPath; while (!Result.empty() && Result[Result.size()-1] != '/') Result.erase(Result.size()-1, 1); @@ -56,8 +57,8 @@ std::string FindExecutable(const std::string &ExeName, if (isExecutableFile(Result)) return Result; // Found it? } - // Okay, if the path to bugpoint didn't tell us anything, try using the PATH - // environment variable. + // Okay, if the path to the program didn't tell us anything, try using the + // PATH environment variable. const char *PathStr = getenv("PATH"); if (PathStr == 0) return "";