aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-11 00:32:40 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-11 00:32:40 -0400
commit67735c6f1557092efe6e8c1712445c30655fe283 (patch)
tree82eaedf770f3893192bb251bbae0db470762f230 /src/analyze.cpp
parent5ee5933ade09c535bd1806d91cb606f49d07acea (diff)
downloadzig-67735c6f1557092efe6e8c1712445c30655fe283.tar.gz
zig-67735c6f1557092efe6e8c1712445c30655fe283.zip
ability to disable cache. off by default except for...
...zig run, zig build, compiler_rt.a, and builtin.a
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index aa4fda7624..7fe7a48245 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -6367,3 +6367,11 @@ not_integer:
}
return nullptr;
}
+
+Error file_fetch(CodeGen *g, Buf *resolved_path, Buf *contents) {
+ if (g->enable_cache) {
+ return cache_add_file_fetch(&g->cache_hash, resolved_path, contents);
+ } else {
+ return os_fetch_file_path(resolved_path, contents, false);
+ }
+}