[PATCH] D18467: Add disk_space() to llvm::fs
Rafael Ávila de Espíndola via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 27 09:41:22 PDT 2016
rafael accepted this revision.
rafael added a reviewer: rafael.
rafael added a comment.
This revision is now accepted and ready to land.
LGTM with nits.
================
Comment at: lib/Support/Unix/Path.inc:217
@@ +216,3 @@
+ SpaceInfo.capacity =
+ static_cast<uint64_t>(Vfs.f_blocks)* STATVFS_F_FRSIZE(Vfs);
+ SpaceInfo.free = static_cast<uint64_t>(Vfs.f_bfree)* STATVFS_F_FRSIZE(Vfs);
----------------
Put STATVFS_F_FRSIZE(Vfs) in a variable. It is used 3 times.
git-clang-format the patch.
================
Comment at: lib/Support/Windows/Path.inc:155
@@ +154,3 @@
+ErrorOr<space_info> disk_space(const Twine Path) {
+ PULARGE_INTEGER avail, total, free;
+ if (!::GetDiskFreeSpaceExW(Path.str().c_str(), &avail, &total, &free))
----------------
Avail, Total, Free.
http://reviews.llvm.org/D18467
More information about the llvm-commits
mailing list