aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.hpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-08 22:53:35 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-03-08 23:23:11 -0500
commit91955dee587214722daa09e6f3dbff059ac3752e (patch)
tree7f56bf31f93081c63a4bcf03b9e38b7c5b1ca29c /src/analyze.hpp
parent1e634a384ccc0ae57e0343369f7adb0b1b4b9875 (diff)
downloadzig-91955dee587214722daa09e6f3dbff059ac3752e.tar.gz
zig-91955dee587214722daa09e6f3dbff059ac3752e.zip
breaking changes to zig build API and improved caching
* in Zig build scripts, getOutputPath() is no longer a valid function to call, unless setOutputDir() was used, or within a custom make() function. Instead there is more convenient API to use which takes advantage of the caching system. Search this commit diff for `exe.run()` for an example. * Zig build by default enables caching. All build artifacts will go into zig-cache. If you want to access build artifacts in a convenient location, it is recommended to add an `install` step. Otherwise you can use the `run()` API mentioned above to execute programs directly from their location in the cache. Closes #330. `addSystemCommand` is available for programs not built with Zig build. * Please note that Zig does no cache evicting yet. You may have to manually delete zig-cache directories periodically to keep disk usage down. It's planned for this to be a simple Least Recently Used eviction system eventually. * `--output`, `--output-lib`, and `--output-h` are removed. Instead, use `--output-dir` which defaults to the current working directory. Or take advantage of `--cache on`, which will print the main output path to stdout, and the other artifacts will be in the same directory with predictable file names. `--disable-gen-h` is available when one wants to prevent .h file generation. * `@cImport` is always independently cached now. Closes #2015. It always writes the generated Zig code to disk which makes debug info and compile errors better. No more "TODO: remember C source location to display here" * Fix .d file parsing. (Fixes the MacOS CI failure) * Zig no longer creates "temporary files" other than inside a zig-cache directory. This breaks the CLI API that Godbolt uses. The suggested new invocation can be found in this commit diff, in the changes to `test/cli.zig`.
Diffstat (limited to 'src/analyze.hpp')
-rw-r--r--src/analyze.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/analyze.hpp b/src/analyze.hpp
index aa94f0c2c5..22e44ebd3f 100644
--- a/src/analyze.hpp
+++ b/src/analyze.hpp
@@ -31,8 +31,6 @@ ZigType *get_array_type(CodeGen *g, ZigType *child_type, uint64_t array_size);
ZigType *get_slice_type(CodeGen *g, ZigType *ptr_type);
ZigType *get_partial_container_type(CodeGen *g, Scope *scope, ContainerKind kind,
AstNode *decl_node, const char *full_name, Buf *bare_name, ContainerLayout layout);
-ZigType *get_root_container_type(CodeGen *g, const char *full_name, Buf *bare_name,
- RootStruct *root_struct);
ZigType *get_smallest_unsigned_int_type(CodeGen *g, uint64_t x);
ZigType *get_error_union_type(CodeGen *g, ZigType *err_set_type, ZigType *payload_type);
ZigType *get_bound_fn_type(CodeGen *g, ZigFn *fn_entry);
@@ -53,6 +51,7 @@ enum SourceKind {
SourceKindRoot,
SourceKindPkgMain,
SourceKindNonRoot,
+ SourceKindCImport,
};
ZigType *add_source_file(CodeGen *g, ZigPackage *package, Buf *abs_full_path, Buf *source_code,
SourceKind source_kind);
@@ -242,4 +241,6 @@ Error ensure_const_val_repr(IrAnalyze *ira, CodeGen *codegen, AstNode *source_no
void typecheck_panic_fn(CodeGen *g, TldFn *tld_fn, ZigFn *panic_fn);
Buf *type_bare_name(ZigType *t);
Buf *type_h_name(ZigType *t);
+Error create_c_object_cache(CodeGen *g, CacheHash **out_cache_hash, bool verbose);
+
#endif