aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2019-03-18libc: separate linux headers from musl/glibcAndrew Kelley
2019-03-15breaking changes to std.mem.Allocator interface APIAndrew Kelley
Before, allocator implementations had to provide `allocFn`, `reallocFn`, and `freeFn`. Now, they must provide only `reallocFn` and `shrinkFn`. Reallocating from a zero length slice is allocation, and shrinking to a zero length slice is freeing. When the new memory size is less than or equal to the previous allocation size, `reallocFn` now has the option to return `error.OutOfMemory` to indicate that the allocator would not be able to take advantage of the new size. For more details see #1306. This commit closes #1306. This commit paves the way to solving #2009. This commit also introduces a memory leak to all coroutines. There is an issue where a coroutine calls the function and it frees its own stack frame, but then the return value of `shrinkFn` is a slice, which is implemented as an sret struct. Writing to the return pointer causes invalid memory write. We could work around it by having a global helper function which has a void return type and calling that instead. But instead this hack will suffice until I rework coroutines to be non-allocating. Basically coroutines are not supported right now until they are reworked as in #1194.
2019-03-14breaking: fix @typeInfo handling of global error set typeAndrew Kelley
`builtin.TypeInfo.ErrorSet` is now `?[]Error` instead of `struct{errors:[]Error}`. closes #1936
2019-03-13fix target_requires_pic and reloc_modeAndrew Kelley
disable failing thread local variable test. see #2063
2019-03-13breaking: remove --static; add -dynamicAndrew Kelley
`--static` is no longer an option. Instead, Zig makes things as static as possible by default. `-dynamic` can be used to choose a dynamic library rather than a static one. `--enable-pic` is a new option. Usually it will be enabled automatically, but in the case of build-exe with no dynamic libraries on Linux or freestanding, Zig chooses off by default. closes #1703 closes #1828
2019-03-13fix @setRuntimeSafety not able to override release modesAndrew Kelley
2019-03-12don't resolve dynamic linker for static executablesAndrew Kelley
2019-03-12ability to build musl from sourceAndrew Kelley
bundles musl 1.1.21 See #514
2019-03-12building musl start files from sourceAndrew Kelley
2019-03-11stage1 caching system: detect problematic mtimesAndrew Kelley
closes #2045
2019-03-10fix inconsistent type information of optional C pointersAndrew Kelley
solves an assertion failure in LLVM
2019-03-09fix docgen and fix unnecessarily adding .root suffix to objectsAndrew Kelley
2019-03-08breaking changes to zig build API and improved cachingAndrew Kelley
* 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`.
2019-03-07fix linking glibc: caching static libs andAndrew Kelley
handle linking pthread, rt, dl, m better
2019-03-07fix .d file processing and use -MV to quote spacesAndrew Kelley
2019-03-07better behavior when cache dir unavailableAndrew Kelley
and choose different manifest dir for local cache to avoid conflict with zig build
2019-03-07fix regressions on macosAndrew Kelley
2019-03-07dynamic_linker_path can be null on some targetsAndrew Kelley
2019-03-07multi-arch glibc headersAndrew Kelley
2019-03-06cross compile glibc startup filesAndrew Kelley
2019-03-05build libunwind.a from source and link itAndrew Kelley
2019-03-05support glibc dl, m, pthread, rtAndrew Kelley
2019-03-05dynamic linker path is independent from libc installationAndrew Kelley
2019-03-05stop linking against gcc filesAndrew Kelley
2019-03-04initial glibc supportAndrew Kelley
2019-03-03fix slice of C pointerAndrew Kelley
closes #2002
2019-03-03fix const initialization of optional C pointer to nullAndrew Kelley
2019-03-02rename std lib files to new conventionAndrew Kelley
2019-03-02@returnAddress and @frameAddress return usize nowAndrew Kelley
2019-03-02all integers returned by @typeInfo are now comptime_intSahnvour
2019-03-02compile error for import outside package pathAndrew Kelley
closes #2024 there's a new cli option `--main-pkg-path` which you can use to choose a different root package directory besides the one inferred from the root source file and a corresponding build.zig API: foo.setMainPkgPath(path)
2019-03-01Merge pull request #2020 from ziglang/kill-namespace-typeAndrew Kelley
remove the (namespace) type and make every file an empty struct
2019-03-01gen-h: respect @exportAndrew Kelley
2019-03-01gen-h: use the bare type names for nowAndrew Kelley
2019-03-01@typeInfo for structs and opaque types is the bare nameAndrew Kelley
2019-03-01fix dependency loops, pub, tests, use decls, root sourceAndrew Kelley
* fix dependency loop detection - closes #679 - closes #1500 * fix `pub` * fix tests * fix use decls * main package file gets a special "" namespace path
2019-03-01Use bitwise-and instead of modulo in __zig_return_errorMarc Tiehuis
Avoids emitting compiler-rt div calls on some targets.
2019-02-28struct types get fully qualified namesAndrew Kelley
and function symbol names become fully qualified
2019-02-28remove namespace type; files are empty structsAndrew Kelley
closes #1047
2019-02-27fix incorrect use of printf in previous commitAndrew Kelley
2019-02-27print the command that failed when C source code fails to buildAndrew Kelley
also respect the --color arg when building C code
2019-02-26fix handling when there are multiple externs andAndrew Kelley
an export in the same object closes #529
2019-02-26introduce sys_include_dir for when sys/* files are not with stdlib.hAndrew Kelley
2019-02-26fix regressions on WindowsAndrew Kelley
2019-02-26breaking changes to the way targets work in zigAndrew Kelley
* CLI: `-target [name]` instead of `--target-*` args. This matches clang's API. * `builtin.Environ` renamed to `builtin.Abi` - likewise `builtin.environ` renamed to `builtin.abi` * stop hiding the concept of sub-arch. closes #1526 * `zig targets` only shows available targets. closes #438 * include all targets in readme, even those that don't print with `zig targets` but note they are Tier 4 * refactor target.cpp and make the naming conventions more consistent * introduce the concept of a "default C ABI" for a given OS/Arch combo. As a rule of thumb, if the system compiler is clang or gcc then the default C ABI is the gnu ABI.
2019-02-26use -nostdinc and sometimes -nolibc when compiling C codeAndrew Kelley
2019-02-26use -nostdinc++ when compiling C codeAndrew Kelley
2019-02-26use -nobuiltininc when compiling c codeAndrew Kelley
2019-02-25fix not finding libgcc_s when looking for native libcAndrew Kelley
closes #2011
2019-02-25`@cImport` works with `--cache on`Andrew Kelley
We pass -MD -MF args to clang when doing `@cImport`, which gives us a complete list of files that the C code read from. Then we add these to the cache. So even when using `@cImport` Zig's caching system remains perfect. This is a proof of concept for the mechanism that the self-hosted compiler will use to watch and rebuild files.