summaryrefslogtreecommitdiff
path: root/src/ccache.cpp
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2023-03-06 20:26:06 +0100
committerJoel Rosdahl <joel@rosdahl.net>2023-03-07 20:17:35 +0100
commit38ab9d38b52c873da1338f4d5eb58edb2ad5c2bc (patch)
tree46bd9bffc98ad756f40b487702b5c95acbcd3467 /src/ccache.cpp
parent03023ee78c0a34aab305ff61b2851248eb77c673 (diff)
downloadccache-38ab9d38b52c873da1338f4d5eb58edb2ad5c2bc.tar.gz
refactor: Use util::BitSet for hash_source_code_file
Diffstat (limited to 'src/ccache.cpp')
-rw-r--r--src/ccache.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ccache.cpp b/src/ccache.cpp
index 7d3eabdf..9efbd563 100644
--- a/src/ccache.cpp
+++ b/src/ccache.cpp
@@ -394,9 +394,9 @@ do_remember_include_file(Context& ctx,
if (ctx.config.direct_mode()) {
if (!is_pch) { // else: the file has already been hashed.
- int result = hash_source_code_file(ctx, file_digest, path);
- if (result & HASH_SOURCE_CODE_ERROR
- || result & HASH_SOURCE_CODE_FOUND_TIME) {
+ auto ret = hash_source_code_file(ctx, file_digest, path);
+ if (ret.contains(HashSourceCode::error)
+ || ret.contains(HashSourceCode::found_time)) {
return false;
}
}
@@ -1822,12 +1822,12 @@ get_manifest_key(Context& ctx, Hash& hash)
hash.hash_delimiter("sourcecode hash");
Digest input_file_digest;
- int result =
+ auto ret =
hash_source_code_file(ctx, input_file_digest, ctx.args_info.input_file);
- if (result & HASH_SOURCE_CODE_ERROR) {
+ if (ret.contains(HashSourceCode::error)) {
return nonstd::make_unexpected(Statistic::internal_error);
}
- if (result & HASH_SOURCE_CODE_FOUND_TIME) {
+ if (ret.contains(HashSourceCode::found_time)) {
LOG_RAW("Disabling direct mode");
ctx.config.set_direct_mode(false);
return {};