diff options
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Support/ConvertUTF.h | 15 | ||||
-rw-r--r-- | llvm/include/llvm/Support/Path.h | 4 | ||||
-rw-r--r-- | llvm/lib/Support/Windows/DynamicLibrary.inc | 1 | ||||
-rw-r--r-- | llvm/lib/Support/Windows/Path.inc | 1 | ||||
-rw-r--r-- | llvm/lib/Support/Windows/Process.inc | 1 | ||||
-rw-r--r-- | llvm/lib/Support/Windows/Program.inc | 1 | ||||
-rw-r--r-- | llvm/lib/Support/Windows/Signals.inc | 1 | ||||
-rw-r--r-- | llvm/lib/Support/Windows/WindowsSupport.h | 14 |
8 files changed, 24 insertions, 14 deletions
diff --git a/llvm/include/llvm/Support/ConvertUTF.h b/llvm/include/llvm/Support/ConvertUTF.h index 99ae171aeab..d4846929780 100644 --- a/llvm/include/llvm/Support/ConvertUTF.h +++ b/llvm/include/llvm/Support/ConvertUTF.h @@ -286,6 +286,21 @@ bool convertUTF16ToUTF8String(ArrayRef<UTF16> Src, std::string &Out); bool convertUTF8ToUTF16String(StringRef SrcUTF8, SmallVectorImpl<UTF16> &DstUTF16); +#if defined(_WIN32) +namespace sys { +namespace windows { +std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16); +/// Convert to UTF16 from the current code page used in the system +std::error_code CurCPToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16); +std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len, + SmallVectorImpl<char> &utf8); +/// Convert from UTF16 to the current code page used in the system +std::error_code UTF16ToCurCP(const wchar_t *utf16, size_t utf16_len, + SmallVectorImpl<char> &utf8); +} // namespace windows +} // namespace sys +#endif + } /* end namespace llvm */ #endif diff --git a/llvm/include/llvm/Support/Path.h b/llvm/include/llvm/Support/Path.h index 57c33592728..d580284af60 100644 --- a/llvm/include/llvm/Support/Path.h +++ b/llvm/include/llvm/Support/Path.h @@ -467,6 +467,10 @@ StringRef remove_leading_dotslash(StringRef path, Style style = Style::native); bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false, Style style = Style::native); +#if defined(_WIN32) +std::error_code widenPath(const Twine &Path8, SmallVectorImpl<wchar_t> &Path16); +#endif + } // end namespace path } // end namespace sys } // end namespace llvm diff --git a/llvm/lib/Support/Windows/DynamicLibrary.inc b/llvm/lib/Support/Windows/DynamicLibrary.inc index 083ea902eeb..1d47f0848a6 100644 --- a/llvm/lib/Support/Windows/DynamicLibrary.inc +++ b/llvm/lib/Support/Windows/DynamicLibrary.inc @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "WindowsSupport.h" +#include "llvm/Support/ConvertUTF.h" #include "llvm/Support/raw_ostream.h" #include <psapi.h> diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc index ab3b222397f..0d1631d6bb0 100644 --- a/llvm/lib/Support/Windows/Path.inc +++ b/llvm/lib/Support/Windows/Path.inc @@ -17,6 +17,7 @@ //===----------------------------------------------------------------------===// #include "llvm/ADT/STLExtras.h" +#include "llvm/Support/ConvertUTF.h" #include "llvm/Support/WindowsError.h" #include <fcntl.h> #include <io.h> diff --git a/llvm/lib/Support/Windows/Process.inc b/llvm/lib/Support/Windows/Process.inc index 612eca56413..b1dbc5e3b0e 100644 --- a/llvm/lib/Support/Windows/Process.inc +++ b/llvm/lib/Support/Windows/Process.inc @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/Allocator.h" +#include "llvm/Support/ConvertUTF.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/WindowsError.h" #include <malloc.h> diff --git a/llvm/lib/Support/Windows/Program.inc b/llvm/lib/Support/Windows/Program.inc index 52921cd6a20..73542c19dc3 100644 --- a/llvm/lib/Support/Windows/Program.inc +++ b/llvm/lib/Support/Windows/Program.inc @@ -16,6 +16,7 @@ #include "llvm/Support/ConvertUTF.h" #include "llvm/Support/Errc.h" #include "llvm/Support/FileSystem.h" +#include "llvm/Support/Path.h" #include "llvm/Support/WindowsError.h" #include "llvm/Support/raw_ostream.h" #include <cstdio> diff --git a/llvm/lib/Support/Windows/Signals.inc b/llvm/lib/Support/Windows/Signals.inc index cc225d9824d..41eb5e593aa 100644 --- a/llvm/lib/Support/Windows/Signals.inc +++ b/llvm/lib/Support/Windows/Signals.inc @@ -10,6 +10,7 @@ // This file provides the Win32 specific implementation of the Signals class. // //===----------------------------------------------------------------------===// +#include "llvm/Support/ConvertUTF.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/Process.h" diff --git a/llvm/lib/Support/Windows/WindowsSupport.h b/llvm/lib/Support/Windows/WindowsSupport.h index 7b741ace85d..c2fd6bb982d 100644 --- a/llvm/lib/Support/Windows/WindowsSupport.h +++ b/llvm/lib/Support/Windows/WindowsSupport.h @@ -247,21 +247,7 @@ inline FILETIME toFILETIME(TimePoint<> TP) { return Time; } -namespace path { -std::error_code widenPath(const Twine &Path8, - SmallVectorImpl<wchar_t> &Path16); -} // end namespace path - namespace windows { -std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16); -/// Convert to UTF16 from the current code page used in the system -std::error_code CurCPToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16); -std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len, - SmallVectorImpl<char> &utf8); -/// Convert from UTF16 to the current code page used in the system -std::error_code UTF16ToCurCP(const wchar_t *utf16, size_t utf16_len, - SmallVectorImpl<char> &utf8); - // Returns command line arguments. Unlike arguments given to main(), // this function guarantees that the returned arguments are encoded in // UTF-8 regardless of the current code page setting. |