summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows/Path.inc
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-08-04 17:43:49 +0000
committerReid Kleckner <rnk@google.com>2017-08-04 17:43:49 +0000
commitaf3e93ac932b89f224db44ff64d64589f0508645 (patch)
treed658396367ac32fc33394e381acfc38abdff2880 /llvm/lib/Support/Windows/Path.inc
parent96d6008145e41095c3f027868f4edea9074561e0 (diff)
downloadbcm5719-llvm-af3e93ac932b89f224db44ff64d64589f0508645.tar.gz
bcm5719-llvm-af3e93ac932b89f224db44ff64d64589f0508645.zip
[Support] Remove getPathFromOpenFD, it was unused
Summary: It was added to support clang warnings about includes with case mismatches, but it ended up not being necessary. Reviewers: twoh, rafael Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D36328 llvm-svn: 310078
Diffstat (limited to 'llvm/lib/Support/Windows/Path.inc')
-rw-r--r--llvm/lib/Support/Windows/Path.inc36
1 files changed, 0 insertions, 36 deletions
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index b00d3905f65..60c03645a57 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -959,42 +959,6 @@ std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
return std::error_code();
}
-std::error_code getPathFromOpenFD(int FD, SmallVectorImpl<char> &ResultPath) {
- HANDLE FileHandle = reinterpret_cast<HANDLE>(::_get_osfhandle(FD));
- if (FileHandle == INVALID_HANDLE_VALUE)
- return make_error_code(errc::bad_file_descriptor);
-
- DWORD CharCount;
- SmallVector<wchar_t, 1024> TempPath;
- do {
- CharCount = ::GetFinalPathNameByHandleW(FileHandle, TempPath.begin(),
- TempPath.capacity(),
- FILE_NAME_NORMALIZED);
- if (CharCount < TempPath.capacity())
- break;
-
- // Reserve sufficient space for the path as well as the null character. Even
- // though the API does not document that it is required, if we reserve just
- // CharCount space, the function call will not store the resulting path and
- // still report success.
- TempPath.reserve(CharCount + 1);
- } while (true);
-
- if (CharCount == 0)
- return mapWindowsError(::GetLastError());
-
- TempPath.set_size(CharCount);
-
- // On earlier Windows releases, the character count includes the terminating
- // null.
- if (TempPath.back() == L'\0') {
- --CharCount;
- TempPath.pop_back();
- }
-
- return windows::UTF16ToUTF8(TempPath.data(), CharCount, ResultPath);
-}
-
std::error_code remove_directories(const Twine &path, bool IgnoreErrors) {
// Convert to utf-16.
SmallVector<wchar_t, 128> Path16;
OpenPOWER on IntegriCloud