Path: Add GetEXESuffix() to complement GetDLLSuffix().
authorMikhail Glushenkov <foldr@codedgers.com>
Tue, 2 Nov 2010 20:32:26 +0000 (20:32 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Tue, 2 Nov 2010 20:32:26 +0000 (20:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118042 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/System/Path.h
lib/System/Unix/Path.inc
lib/System/Win32/Path.inc

index ef7c087bb76b756052b083d2f7a3347ed88c70c0..c13f2e8d6c41315ffb05df3643534c30af93d81b 100644 (file)
@@ -154,6 +154,12 @@ 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();
+
       /// Return the suffix commonly used on file names that contain a shared
       /// object, shared archive, or dynamic link library. Such files are
       /// linked at runtime into a process and their code images are shared
index 4c97c4b71ccf96c89e7e3ea8aa7f82ead5b4359a..44c81a2f3f92aa1959ab112a5b934b0675991f1b 100644 (file)
@@ -78,6 +78,10 @@ using namespace sys;
 
 const char sys::PathSeparator = ':';
 
+StringRef Path::GetEXESuffix() {
+  return "";
+}
+
 Path::Path(StringRef p)
   : path(p) {}
 
index 7e2275105a320f6bf15c429f2ec729adefdcd61d..a4d55a0f048f6df98662698c1e839f8bdf85ecbe 100644 (file)
@@ -45,8 +45,13 @@ static void FlipBackSlashes(std::string& s) {
 
 namespace llvm {
 namespace sys {
+
 const char PathSeparator = ';';
 
+StringRef Path::GetEXESuffix() {
+  return "exe";
+}
+
 Path::Path(llvm::StringRef p)
   : path(p) {
   FlipBackSlashes(path);