[llvm] [Support][Windows] disk_space handle unicode paths (PR #170716)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 4 15:30:43 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,inc -- llvm/lib/Support/CachePruning.cpp llvm/lib/Support/Windows/Path.inc --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Support/CachePruning.cpp b/llvm/lib/Support/CachePruning.cpp
index c3a190bd3..2210e0c31 100644
--- a/llvm/lib/Support/CachePruning.cpp
+++ b/llvm/lib/Support/CachePruning.cpp
@@ -281,7 +281,8 @@ bool llvm::pruneCache(StringRef Path, CachePruningPolicy Policy,
auto ErrOrSpaceInfo = sys::fs::disk_space(Path);
if (!ErrOrSpaceInfo) {
auto EC = ErrOrSpaceInfo.getError();
- report_fatal_error("Can't get available size for '" + Path.str() + "': " + EC.message());
+ report_fatal_error("Can't get available size for '" + Path.str() +
+ "': " + EC.message());
}
sys::fs::space_info SpaceInfo = ErrOrSpaceInfo.get();
auto AvailableSpace = TotalSize + SpaceInfo.free;
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index a133b3ddd..717a124f9 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -179,7 +179,7 @@ ErrorOr<space_info> disk_space(const Twine &Path) {
return mapWindowsError(::GetLastError());
space_info SpaceInfo;
- SpaceInfo.capacity = Total.QuadPart;
+ SpaceInfo.capacity = Total.QuadPart;
SpaceInfo.free = Free.QuadPart;
SpaceInfo.available = Avail.QuadPart;
``````````
</details>
https://github.com/llvm/llvm-project/pull/170716
More information about the llvm-commits
mailing list