diff options
author | Paul Robinson <paul_robinson@playstation.sony.com> | 2014-11-24 18:05:29 +0000 |
---|---|---|
committer | Paul Robinson <paul_robinson@playstation.sony.com> | 2014-11-24 18:05:29 +0000 |
commit | c38deee8076f300e29214648108eddf33db3e200 (patch) | |
tree | 77fc1d8193c2ab93d0bfa168f313235f4dc652aa /llvm/lib/Support/Windows/Path.inc | |
parent | 397a25e7cd945723859e76241269ac0657526c7a (diff) | |
download | bcm5719-llvm-c38deee8076f300e29214648108eddf33db3e200.tar.gz bcm5719-llvm-c38deee8076f300e29214648108eddf33db3e200.zip |
More long path name support on Windows, this time in program execution.
Allows long paths for the executable and redirected stdin/stdout/stderr.
Addresses PR21563.
llvm-svn: 222671
Diffstat (limited to 'llvm/lib/Support/Windows/Path.inc')
-rw-r--r-- | llvm/lib/Support/Windows/Path.inc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc index 365031cf150..adb9a60857f 100644 --- a/llvm/lib/Support/Windows/Path.inc +++ b/llvm/lib/Support/Windows/Path.inc @@ -44,6 +44,7 @@ using namespace llvm; using llvm::sys::windows::UTF8ToUTF16; using llvm::sys::windows::UTF16ToUTF8; +using llvm::sys::path::widenPath; static std::error_code windows_error(DWORD E) { return mapWindowsError(E); @@ -59,11 +60,15 @@ static bool is_separator(const wchar_t value) { } } +namespace llvm { +namespace sys { +namespace path { + // Convert a UTF-8 path to UTF-16. Also, if the absolute equivalent of the // path is longer than CreateDirectory can tolerate, make it absolute and // prefixed by '\\?\'. -static std::error_code widenPath(const Twine &Path8, - SmallVectorImpl<wchar_t> &Path16) { +std::error_code widenPath(const Twine &Path8, + SmallVectorImpl<wchar_t> &Path16) { const size_t MaxDirLen = MAX_PATH - 12; // Must leave room for 8.3 filename. // Several operations would convert Path8 to SmallString; more efficient to @@ -111,9 +116,8 @@ static std::error_code widenPath(const Twine &Path8, // Just use the caller's original path. return UTF8ToUTF16(Path8Str, Path16); } +} // end namespace path -namespace llvm { -namespace sys { namespace fs { std::string getMainExecutable(const char *argv0, void *MainExecAddr) { |