Index: llvm/trunk/include/llvm/Support/ConvertUTF.h =================================================================== --- llvm/trunk/include/llvm/Support/ConvertUTF.h +++ llvm/trunk/include/llvm/Support/ConvertUTF.h @@ -286,6 +286,21 @@ bool convertUTF8ToUTF16String(StringRef SrcUTF8, SmallVectorImpl &DstUTF16); +#if defined(_WIN32) +namespace sys { +namespace windows { +std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl &utf16); +/// Convert to UTF16 from the current code page used in the system +std::error_code CurCPToUTF16(StringRef utf8, SmallVectorImpl &utf16); +std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len, + SmallVectorImpl &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 &utf8); +} // namespace windows +} // namespace sys +#endif + } /* end namespace llvm */ #endif Index: llvm/trunk/include/llvm/Support/Path.h =================================================================== --- llvm/trunk/include/llvm/Support/Path.h +++ llvm/trunk/include/llvm/Support/Path.h @@ -467,6 +467,10 @@ bool remove_dots(SmallVectorImpl &path, bool remove_dot_dot = false, Style style = Style::native); +#if defined(_WIN32) +std::error_code widenPath(const Twine &Path8, SmallVectorImpl &Path16); +#endif + } // end namespace path } // end namespace sys } // end namespace llvm Index: llvm/trunk/lib/Support/Windows/DynamicLibrary.inc =================================================================== --- llvm/trunk/lib/Support/Windows/DynamicLibrary.inc +++ llvm/trunk/lib/Support/Windows/DynamicLibrary.inc @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "WindowsSupport.h" +#include "llvm/Support/ConvertUTF.h" #include "llvm/Support/raw_ostream.h" #include Index: llvm/trunk/lib/Support/Windows/Path.inc =================================================================== --- llvm/trunk/lib/Support/Windows/Path.inc +++ llvm/trunk/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 #include Index: llvm/trunk/lib/Support/Windows/Process.inc =================================================================== --- llvm/trunk/lib/Support/Windows/Process.inc +++ llvm/trunk/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 Index: llvm/trunk/lib/Support/Windows/Program.inc =================================================================== --- llvm/trunk/lib/Support/Windows/Program.inc +++ llvm/trunk/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 Index: llvm/trunk/lib/Support/Windows/Signals.inc =================================================================== --- llvm/trunk/lib/Support/Windows/Signals.inc +++ llvm/trunk/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" Index: llvm/trunk/lib/Support/Windows/WindowsSupport.h =================================================================== --- llvm/trunk/lib/Support/Windows/WindowsSupport.h +++ llvm/trunk/lib/Support/Windows/WindowsSupport.h @@ -247,21 +247,7 @@ return Time; } -namespace path { -std::error_code widenPath(const Twine &Path8, - SmallVectorImpl &Path16); -} // end namespace path - namespace windows { -std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl &utf16); -/// Convert to UTF16 from the current code page used in the system -std::error_code CurCPToUTF16(StringRef utf8, SmallVectorImpl &utf16); -std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len, - SmallVectorImpl &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 &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.