aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2019-04-16freestanding target adds -ffrestanding to cc parametersAndrew Kelley
closes #2287
2019-04-15fix Debug mode when error return tracing is offAndrew Kelley
Previously the code for generating a panic crash expected one of the parameters to be the error return trace. Now it does not expect that parameter when g->have_err_ret_tracing is false. Closes #2276
2019-04-15wasm: add wasm-import-module attr to externShritesh Bhattarai
2019-04-14organize how the single threaded option is passed aroundAndrew Kelley
2019-04-12wasm: use .wasm ext for exeShritesh Bhattarai
2019-04-11wasm: disable error ret tracingShritesh Bhattarai
2019-04-10compiler-rt: better way to do the ABI required on WindowsAndrew Kelley
This removes the compiler_rt.setXmm0 hack. Instead, for the functions that use i128 or u128 in their parameter and return types, we use `@Vector(2, u64)` which generates the LLVM IR `<2 x i64>` type that matches what Clang generates for `typedef int ti_int __attribute__ ((mode (TI)))` when targeting Windows x86_64.
2019-04-04fix NaN comparing equal to itselfAndrew Kelley
This was broken both in comptime code and in runtime code. closes #1174
2019-04-04fix `@divFloor` returning incorrect value and add `__modti3`Andrew Kelley
Closes #2152 See #1290
2019-04-04fix thread local variables for non- position independent codeAndrew Kelley
This fixes comes thanks to Rich Felker from the musl libc project, who gave me this crucial information: "to satisfy the abi, your init code has to write the same value to that memory location as the value passed to the [arch_prctl] syscall" This commit also changes the rules for when to build statically by default. When building objects and static libraries, position independent code is disabled if no libraries will be dynamically linked and the target does not require position independent code. closes #2063
2019-04-02passing all testsAndrew Kelley
2019-04-02more regression fixes. empty test passes againAndrew Kelley
2019-04-02more regression fixesAndrew Kelley
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