summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-07-16 02:55:33 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-07-16 02:55:33 +0000
commit9da91a0e03af28eab74be172cd601c5149ae5d0e (patch)
tree10f1367fbe7552a43cba4acd3c8515dc489672fa /llvm/lib/Support/Windows
parentbe2978b2e4326b60351aa6bc5a6cfbe679d9ce26 (diff)
downloadbcm5719-llvm-9da91a0e03af28eab74be172cd601c5149ae5d0e.tar.gz
bcm5719-llvm-9da91a0e03af28eab74be172cd601c5149ae5d0e.zip
Instead friending status, provide windows and posix constructors to file_status.
This opens the way of having static helpers in the .inc files that can construct a file_status. llvm-svn: 186376
Diffstat (limited to 'llvm/lib/Support/Windows')
-rw-r--r--llvm/lib/Support/Windows/Path.inc15
1 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index b0235933dfd..1ecd80329cc 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -632,7 +632,6 @@ error_code status(const Twine &path, file_status &result) {
if (attr & FILE_ATTRIBUTE_DIRECTORY)
result = file_status(file_type::directory_file);
else {
- result = file_status(file_type::regular_file);
ScopedFileHandle h(
::CreateFileW(path_utf16.begin(),
0, // Attributes only.
@@ -646,15 +645,13 @@ error_code status(const Twine &path, file_status &result) {
BY_HANDLE_FILE_INFORMATION Info;
if (!::GetFileInformationByHandle(h, &Info))
goto handle_status_error;
- result.FileIndexHigh = Info.nFileIndexHigh;
- result.FileIndexLow = Info.nFileIndexLow;
- result.FileSizeHigh = Info.nFileSizeHigh;
- result.FileSizeLow = Info.nFileSizeLow;
- result.LastWriteTimeHigh = Info.ftLastWriteTime.dwHighDateTime;
- result.LastWriteTimeLow = Info.ftLastWriteTime.dwLowDateTime;
- result.VolumeSerialNumber = Info.dwVolumeSerialNumber;
- }
+ result = file_status(
+ file_type::regular_file, Info.ftLastWriteTime.dwHighDateTime,
+ Info.ftLastWriteTime.dwLowDateTime, Info.dwVolumeSerialNumber,
+ Info.nFileSizeHigh, Info.nFileSizeLow, Info.nFileIndexHigh,
+ Info.nFileIndexLow);
+ }
return error_code::success();
handle_status_error:
OpenPOWER on IntegriCloud