aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2020-03-27zig c++: get it working with musl and mingw-w64Andrew Kelley
2020-03-26ability to compile c++ hello world with `zig c++`Andrew Kelley
closes #4786
2020-03-25improved handling of native system directoriesAndrew Kelley
* `-isystem` instead of `-I` for system include directories fixes a problem with native system directories interfering with zig's bundled libc. * separate Stage2Target.is_native into Stage2Target.is_native_os and Stage2Target.is_native_cpu.
2020-03-22riscv: add -mrelax arg for C to work around upstream issueAndrew Kelley
See #4485
2020-03-22Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-22Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-21zig cc: detect optimization and debug flagsAndrew Kelley
2020-03-21zig cc: better support for the preprocessor option (-E)Andrew Kelley
2020-03-21ability to use `zig cc` as a drop-in C compilerAndrew Kelley
The basics are working
2020-03-20glibc: include ld symbols and proper soname for ldAndrew Kelley
2020-03-19Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-19fix incorrect sentinel checkAndrew Kelley
2020-03-19fix runtime slice of pointer not setting lengthAndrew Kelley
2020-03-19fix regression when slicing 0-bit pointersAndrew Kelley
2020-03-19fixes in semantic analysis needed to support this featureAndrew Kelley
2020-03-19slicing with comptime start and end results in arrayAndrew Kelley
implements #863
2020-03-19ir: More changes to sentinel-terminated const arraysLemonBoy
* Don't add an extra slot for the sentinel. Most of the code keeps using the constant value from the type descriptor, let's harmonize all the code dealing with sentinels. * Properly write out sentinel values when reinterpreting pointers at comptime. * Allow the reading of the 0th element in a `[0:S]T` type.
2020-03-18ir: Correct ABI size calculation for arraysLemonBoy
Zero-length array with a sentinel may not have zero size. Closes #4749
2020-03-14for build-obj with only 1 C file, name .o file after root_out_nameAndrew Kelley
2020-03-13special case when doing build-obj with just one source fileAndrew Kelley
When building an object file from only one source file, instead of having a two-stage cache system, we special case it and use the cache directory that the .o file is output to as the final cache directory for all the build artifacts. When there are more than 1 source file, the linker has to merge objects into one, and so the two stage approach makes sens. But in the case of only one source file, this prevents needlessly copying the object file. This commit fixes an issue with the previous one, where zig with cache enabled would print a directory that actually did not have any build artifacts in it.
2020-03-13Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-12Merge pull request #4707 from Vexu/small-atomicsAndrew Kelley
Support atomic operations with bools and non power of two integers
2020-03-12Simplify stores, use sext for signed intsVexu
2020-03-11fix zig-cache to treat cpu-features as raw-bytesMichael Dusan
- add Stage2Target.cache_hash_len - add cache_mem(ch, ptr, len) - update call sites to use { ptr, len }
2020-03-11Move abi size checking to codegenVexu
2020-03-11fix codegen, update docsVexu
2020-03-11support non power of two integers in atomic opsVexu
2020-03-10support atomic operations with boolsVexu
2020-03-10ir: Implement more safety checks for shl/shrLemonBoy
The checks are now valid on types whose size is not a power of two. Closes #2096
2020-03-09ir: Fix codegen of ?*T types where T is zero-sizedLemonBoy
* Fix codegen for optional types that decay to a pointer, the type behaves as a boolean * Fix comptime evaluation of zero-sized arrays, always initialize the internal array elements Closes #4673
2020-03-09add LemonBoy's testVexu
2020-03-09implement noasync scopesVexu
2020-03-07Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-04ir: Implement @TypeOf with multiple argumentsLemonBoy
Closes #439
2020-03-04get_codegen_ptr_type returns possible errorAndrew Kelley
And fix most of the fallout. This also makes optional pointers not require resolving zero bits, because the comptime value struct layout no longer depends on whether the type has zero bits. Thanks to @LemonBoy for the behavior test case Closes #4357 Closes #4359
2020-03-04Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-03-04Fix docs generationTimon Kruiper
Commit edb210905dcbe666fa5222bceacd2e5bdb16bb89 caused the docs generation to fail, because all the type information in pass1 was already freed in `zig_llvm_emit_output`.
2020-03-03Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-02-29Merge pull request #4550 from ziglang/os-version-rangesAndrew Kelley
introduce operating system version ranges as part of the target; self-host native dynamic linker detection and native glibc version detection
2020-02-29C pointer slices are no longer allowzero (#4462)Alexandros Naskos
* Slices from C pointers are no longer allowzero but instead insert a runtime assertion. * Added a test, fixed code for cases with non-allowzero C pointers * Create new type when flipping allow_zero, sometimes we get a cached value back from adjust_ptr_len. * Added comments, changed panic message * Added runtime safety test.
2020-02-28dynamic_linker becomes a field of std.zig.CrossTargetAndrew Kelley
2020-02-28remove special darwin os version min handlingAndrew Kelley
now it is integrated with zig's target OS range.
2020-02-28introduce operating system version ranges as part of the targetAndrew Kelley
* re-introduce `std.build.Target` which is distinct from `std.Target`. `std.build.Target` wraps `std.Target` so that it can be annotated as "the native target" or an explicitly specified target. * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a struct which has the tag as well as version range information. * `std.elf` gains some more ELF header constants. * `std.Target.parse` gains the ability to parse operating system version ranges as well as glibc version. * Added `std.Target.isGnuLibC()`. * self-hosted dynamic linker detection and glibc version detection. This also adds the improved logic using `/usr/bin/env` rather than invoking the system C compiler to find the dynamic linker when zig is statically linked. Related: #2084 Note: this `/usr/bin/env` code is work-in-progress. * `-target-glibc` CLI option is removed in favor of the new `-target` syntax. Example: `-target x86_64-linux-gnu.2.27` closes #1907
2020-02-26call deinit on the hashmaps introduced in the prev commitAndrew Kelley
2020-02-26fix `@intToEnum` on extern enumsVexu
2020-02-26fix `@tagName` on extern and non-exhaustive enumsVexu
2020-02-25Merge remote-tracking branch 'origin/master' into llvm10Andrew Kelley
2020-02-25remove `@IntType` and `@ArgType` (mostly) from the compilerVexu
2020-02-24remove `@typeId`, `@memberCount`, `@memberName` and `@memberType` from the ↵Vexu
compiler
2020-02-24Merge pull request #4516 from xackus/remove-bytes-to-sliceAndrew Kelley
remove @bytesToSlice, @sliceToBytes from the language