summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-25 14:42:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-25 14:42:30 +0000
commit46fa7cf91af03373b6ab54f31215bb671698000f (patch)
tree1addd0d5d3a20e3c1d0b46a7945a3412f7cd4b09
parentdeeb5724b8e6dfb911bde7c4b5d4e2f10953f52b (diff)
downloadllvm-46fa7cf91af03373b6ab54f31215bb671698000f.tar.gz
llvm-46fa7cf91af03373b6ab54f31215bb671698000f.tar.bz2
llvm-46fa7cf91af03373b6ab54f31215bb671698000f.tar.xz
Move GetEXESuffix to the one place it is used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184853 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/PathV1.h6
-rw-r--r--lib/Support/Unix/Path.inc4
-rw-r--r--lib/Support/Windows/Path.inc4
-rw-r--r--tools/bugpoint/ToolRunner.cpp8
4 files changed, 7 insertions, 15 deletions
diff --git a/include/llvm/Support/PathV1.h b/include/llvm/Support/PathV1.h
index 3202451467..a6d2663681 100644
--- a/include/llvm/Support/PathV1.h
+++ b/include/llvm/Support/PathV1.h
@@ -104,12 +104,6 @@ namespace sys {
/// @brief Returns the current working directory.
static Path GetCurrentDirectory();
- /// Return the suffix commonly used on file names that contain an
- /// executable.
- /// @returns The executable file suffix for the current platform.
- /// @brief Return the executable file suffix.
- static StringRef GetEXESuffix();
-
/// GetMainExecutable - Return the path to the main executable, given the
/// value of argv[0] from program startup and the address of main itself.
/// In extremis, this function may fail and return an empty path.
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc
index 8e31f4cedf..63b0519371 100644
--- a/lib/Support/Unix/Path.inc
+++ b/lib/Support/Unix/Path.inc
@@ -81,10 +81,6 @@ inline bool lastIsSlash(const std::string& path) {
namespace llvm {
using namespace sys;
-StringRef Path::GetEXESuffix() {
- return StringRef();
-}
-
Path::Path(StringRef p)
: path(p) {}
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc
index ba13edc7c8..53767e7a15 100644
--- a/lib/Support/Windows/Path.inc
+++ b/lib/Support/Windows/Path.inc
@@ -42,10 +42,6 @@ static void FlipBackSlashes(std::string& s) {
namespace llvm {
namespace sys {
-StringRef Path::GetEXESuffix() {
- return "exe";
-}
-
Path::Path(llvm::StringRef p)
: path(p) {
FlipBackSlashes(path);
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index 3f0779e2c5..4e6f6e27cc 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -234,6 +234,12 @@ int LLI::ExecuteProgram(const std::string &Bitcode,
void AbstractInterpreter::anchor() { }
+#if defined(LLVM_ON_UNIX)
+const char EXESuffix[] = "";
+#elif defined (LLVM_ON_WIN32)
+const char EXESuffix[] = "exe";
+#endif
+
/// Prepend the path to the program being executed
/// to \p ExeName, given the value of argv[0] and the address of main()
/// itself. This allows us to find another LLVM tool if it is built in the same
@@ -252,7 +258,7 @@ static std::string PrependMainExecutablePath(const std::string &ExeName,
if (!Result.empty()) {
SmallString<128> Storage = Result;
sys::path::append(Storage, ExeName);
- sys::path::replace_extension(Storage, sys::Path::GetEXESuffix());
+ sys::path::replace_extension(Storage, EXESuffix);
return Storage.str();
}