Path: Add GetEXESuffix() to complement GetDLLSuffix().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118042 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov 2010-11-02 20:32:26 +00:00
parent 4638852696
commit f5a95ce0d4
3 changed files with 15 additions and 0 deletions

View 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

View File

@ -78,6 +78,10 @@ using namespace sys;
const char sys::PathSeparator = ':';
StringRef Path::GetEXESuffix() {
return "";
}
Path::Path(StringRef p)
: path(p) {}

View 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);