aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2019-04-02remove the lazy value stuffAndrew Kelley
let's try to keep this branch to solving one problem at a time
2019-04-02introduce lazy valuesAndrew Kelley
but I think it's a bad idea, so I'm going to back out the change
2019-04-02decouple llvm types from zig typesAndrew Kelley
Not tested yet, but it builds. This closes #761, and lays the groundwork for fixing the remaining false positive "foo depends on itself" bugs, such as #624. It also lays the groundwork for implementing ability to specify alignment of fields (#1512).
2019-03-27fix build on arm64Shawn Landden
2019-03-25implement allowzero pointer attributeAndrew Kelley
closes #1953 only needed for freestanding targets. also adds safety for `@intToPtr` when the address is zero.
2019-03-24introduce the enum literal typeAndrew Kelley
see #683
2019-03-20add docs for assembly and fix global assembly parsingAndrew Kelley
Previously, global assembly was parsed expecting it to have the template syntax. However global assembly has no inputs, outputs, or clobbers, and thus does not have template syntax. This is now fixed. This commit also adds a compile error for using volatile on global assembly, since it is meaningless. closes #1515
2019-03-18Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-03-18pass explicit frame pointer args when compiling C codeAndrew Kelley
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-13Merge remote-tracking branch 'origin/master' into llvm8Andrew 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-10Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
2019-03-10fix inconsistent type information of optional C pointersAndrew Kelley
solves an assertion failure in LLVM
2019-03-10Merge remote-tracking branch 'origin/master' into llvm8Andrew Kelley
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-04Merge remote-tracking branch 'origin/master' into llvm8Andrew 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.