aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2020-02-10stage1: memory/report overhaulMichael Dusan
- split util_base.hpp from util.hpp - new namespaces: `mem` and `heap` - new `mem::Allocator` interface - new `heap::CAllocator` impl with global `heap::c_allocator` - new `heap::ArenaAllocator` impl - new `mem::TypeInfo` extracts names without RTTI - name extraction is enabled w/ ZIG_ENABLE_MEM_PROFILE=1 - new `mem::List` takes explicit `Allocator&` parameter - new `mem::HashMap` takes explicit `Allocator&` parameter - add Codegen.pass1_arena and use for all `ZigValue` allocs - deinit Codegen.pass1_arena early in `zig_llvm_emit_output()`
2020-02-10Merge pull request #4404 from ziglang/async-stdAndrew Kelley
a big step towards std lib integration with async I/O
2020-02-09fix defer interfering with return value spillAndrew Kelley
2020-02-08fix async runtime function call resolves target fn frameAndrew Kelley
2020-02-07Add wWinMain and wWinMainCRTStartup to fix #4376Jared Miller
2020-02-07fix async function call resolves target fn frameAndrew Kelley
2020-02-07more carefully calculate llvm field indexesAndrew Kelley
more correctly solves #4403
2020-02-06more std lib async I/O integrationAndrew Kelley
* `zig test` gainst `--test-evented-io` parameter and gains the ability to seamlessly run async tests. * `std.ChildProcess` opens its child process pipe with O_NONBLOCK when using evented I/O * `std.io.getStdErr()` gives a File that is blocking even in evented I/O mode. * Delete `std.event.fs`. The functionality is now merged into `std.fs` and async file system access (using a dedicated thread) is automatically handled. * `std.fs.File` can be configured to specify whether its handle is expected to block, and whether that is OK to block even when in async I/O mode. This makes async I/O work correctly for e.g. the file system as well as network. * `std.fs.File` has some deprecated functions removed. * Missing readv,writev,pread,pwrite,preadv,pwritev functions are added to `std.os` and `std.fs.File`. They are all integrated with async I/O. * `std.fs.Watch` is still bit rotted and needs to be audited in light of the new async/await syntax. * `std.io.OutStream` integrates with async I/O * linked list nodes in the std lib have default `null` values for `prev` and `next`. * Windows async I/O integration is enabled for reading/writing file handles. * Added `std.os.mode_t`. Integer sizes need to be audited. * Fixed #4403 which was causing compiler to crash. This is working towards: ./zig test ../test/stage1/behavior.zig --test-evented-io Which does not successfully build yet. I'd like to enable behavioral tests and std lib tests with --test-evented-io in the test matrix in the future, to prevent regressions.
2020-02-05ability to run tests in evented I/O modeAndrew Kelley
This adds `--test-evented-io` as a CLI parameter. see #3117
2020-01-29Add support for code model selectionValentin Anger
2020-01-28fix regression of storing optional with 0-bit payloadAndrew Kelley
2020-01-27fix assertion with var debug loc not initializedAndrew Kelley
2020-01-27fix nested bitcast passed as tuple elementAndrew Kelley
2020-01-27Merge branch 'master' into ir-clean-up-varsAndrew Kelley
2020-01-25Merge remote-tracking branch 'origin/master' into layneson-cpus_and_featuresAndrew Kelley
2020-01-25Merge pull request #4290 from ziglang/split-ir-structsAndrew Kelley
split IrInstruction into IrInst, IrInstSrc, IrInstGen
2020-01-25split IrInstruction into IrInst, IrInstSrc, IrInstGenAndrew Kelley
This makes it so that less memory is used for IR instructions, as well as catching bugs when one expected one kind of instruction and received the other.
2020-01-24Merge pull request #4279 from mikdusan/create-global-cacheMichael Dusan
stage1: make sure to create native_libc.txt dir
2020-01-23Don't include stdbool.h for void and unreachableTadeo Kondrak
Fixes https://github.com/ziglang/zig/issues/4272
2020-01-23stage1: make sure to create native_libc.txt dirMichael Dusan
- fix regression from #4186
2020-01-22aarch64: less feature-full baseline CPUAndrew Kelley
2020-01-22fix not respecting sub-arch featureAndrew Kelley
2020-01-22std.Target.CpuFeatures is now a struct with both CPU and feature setAndrew Kelley
Previously it was a tagged union which was one of: * baseline * a specific CPU * a set of features Now, it's possible to have a CPU but also modify the CPU's feature set on top of that. This is closer to what LLVM does. This is more correct because Zig's notion of CPUs (and LLVM's) is not exact CPU models. For example "skylake" is not one very specific model; there are several different pieces of hardware that match "skylake" that have different feature sets enabled.
2020-01-21enable native CPU feature for windows; disable failing testsAndrew Kelley
See #508. These can be re-enabled when we upgrade to LLVM 10.
2020-01-21put hack back in to disable windows native cpu featuresAndrew Kelley
See #508. This can be removed when we upgrade to LLVM 10.
2020-01-21hit a comptime limitation with computing dense setsAndrew Kelley
2020-01-21properly forward baseline target cpu features to llvmAndrew Kelley
2020-01-19progress towards mergingAndrew Kelley
see BRANCH_TODO file
2020-01-19Pass target_details to child CodeGensLayne Gustafson
2020-01-19Pass target details to c compilerLayne Gustafson
2020-01-19Add defaut feature supportLayne Gustafson
2020-01-19Add builtin.zig supportLayne Gustafson
2020-01-19Add TargetDetails abstractionLayne Gustafson
2020-01-19Add cpu/feature to cache hashLayne Gustafson
2020-01-19Add cpu/feature specification to cmndlineLayne Gustafson
2020-01-17Merge pull request #4191 from Vexu/non-exhaustive-enumsAndrew Kelley
Implement non-exhaustive enums
2020-01-16fix regressions double implicit casting return ptrAndrew Kelley
2020-01-16zig ir.cpp details: remove the mem_slot mechanismAndrew Kelley
Previously, there was hacky code to deal with result locations and how they work with regards to comptime values and runtime values. In addition, there was a hacky "mem_slot" mechanism that managed the memory for local variables, and acted differently depending on comptime vs runtime situations. All that is deleted in this commit, and as a result, result locations code has one less complication. Importantly, this means that a comptime result location is now passed to a function when it is evaluated at comptime. This test causes many regressions, and some of the behavior tests are disabled (commented out) in this commit. Future commits will re-enable the tests before merging the branch.
2020-01-16implement `@bitSizeOf`Vexu
2020-01-16turn panics into compile errors, require at least 1 field in non-exhaustive enumVexu
2020-01-15small fixesVexu
* error for '_' prong on exhaustive enum * todo panic for `@tagName` on non-exhaustive enum * don't require '_' field on tagged unions
2020-01-15stage1: move local native_libc.txt to globalMichael Dusan
Automatic creation of `native_libc.txt` now occurs only in global cache. Manual creation/placement into local cache is supported. closes #3975
2020-01-15implement non-exhaustive enumsVexu
2020-01-14Fix codegen error for some union initializersLemonBoy
Closes #3377
2020-01-13Allow switching on pointer typesLemonBoy
Closes #4074
2020-01-11Stop dropping errors from clangLemonBoy
* Refactor the error-writing code to be more compact and flexible
2020-01-10Inform the debugger about the effective type sizesLemonBoy
Makes every debugger happy and closes #2685
2020-01-09New @export() handlingLemonBoy
Use a struct as second parameter to be future proof (and also allows to specify default values for the parameters) Closes #2679 as it was just a matter of a few lines of code.
2020-01-07cleanups related to --eh-frame-hdrAndrew Kelley
2020-01-07add --eh-frame-hdr conditionallyDavid Cao