aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
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-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
2020-02-23nuke @bytesToSlice, @sliceToBytes in stage1xackus
2020-02-21remove sub-arch from stage1Andrew Kelley
2020-02-19fix generation of builtin importAndrew Kelley
2020-02-19remove the concept of "sub-architecture"Andrew Kelley
in favor of CPU features. Also rearrange the `std.Target` data structure. * note: `@import("builtin")` was already deprecated in favor of `@import("std").builtin`. * `std.builtin.arch` is now deprecated in favor of `std.builtin.cpu.arch`. * `std.Target.CpuFeatures.Cpu` is now `std.Target.Cpu.Model`. * `std.Target.CpuFeatures` is now `std.Target.Cpu`. * `std.Target` no longer has an `arch` field. Instead it has a `cpu` field, which has `arch`, `model`, and `features`. * `std.Target` no longer has a `cpu_features` field. * `std.Target.Arch` is moved to `std.Target.Cpu.Arch` and it is an enum instead of a tagged union. * `std.Target.parseOs` is moved to `std.Target.Os.parse`. * `std.Target.parseAbi` is moved to `std.Target.Abi.parse`. * `std.Target.parseArchSub` is only for arch now and moved to `std.Target.Cpu.Arch.parse`. * `std.Target.parse` is improved to accept CPU name and features. * `std.Target.Arch.getBaselineCpuFeatures` is moved to `std.Target.Cpu.baseline`. * `std.Target.allCpus` is renamed to `std.Target.allCpuModels`. * `std.Target.defaultAbi` is moved to `std.Target.Abi.default`. * Significant cleanup of aarch64 and arm CPU features, resulting in the needed bit count for cpu feature set going from 174 to 138. * Add `std.Target.Cpu.Feature.Set.addFeatureSet` for merging feature sets together. `-target-feature` and `-target-cpu` are removed in favor of `-mcpu`, to conform to established conventions, and it gains additional power to support cpu features. The syntax is: -mcpu=name+on1+on2-off1-off2 closes #4261
2020-02-18improvements which allow zig to emit multiple things at onceAndrew Kelley
example: zig build-obj test.zig -femit-llvm-ir -femit-asm this will generate all three: test.o test.s test.ll
2020-02-18Improve support for generating LLVM IR/asm filesNoam Preil
2020-02-17target_os_requires_libc implies dynamic linkingAndrew Kelley
2020-02-17fix glibc not forcing dynamic linkAndrew Kelley
2020-02-17target requiring PIC does not imply dynamic linkingAndrew Kelley
Related: #3237
2020-02-17support the concept of a target not having a dynamic linkerAndrew Kelley
2020-02-17self-host dynamic linker detectionAndrew Kelley
2020-02-16rename libuserland to libstage2Andrew Kelley
2020-02-16self-hosted libc detectionAndrew Kelley
* libc_installation.cpp is deleted. src-self-hosted/libc_installation.zig is now used for both stage1 and stage2 compilers. * (breaking) move `std.fs.File.access` to `std.fs.Dir.access`. The API now encourages use with an open directory handle. * Add `std.os.faccessat` and related functions. * Deprecate the "C" suffix naming convention for null-terminated parameters. "C" should be used when it is related to libc. However null-terminated parameters often have to do with the native system ABI rather than libc. "Z" suffix is the new convention. For example, `std.os.openC` is deprecated in favor of `std.os.openZ`. * Add `std.mem.dupeZ` for using an allocator to copy memory and add a null terminator. * Remove dead struct field `std.ChildProcess.llnode`. * Introduce `std.event.Batch`. This API allows expressing concurrency without forcing code to be async. It requires no Allocator and does not introduce any failure conditions. However it is not thread-safe. * There is now an ongoing experiment to transition away from `std.event.Group` in favor of `std.event.Batch`. * `std.os.execvpeC` calls `getenvZ` rather than `getenv`. This is slightly more efficient on most systems, and works around a limitation of `getenv` lack of integration with libc. * (breaking) `std.os.AccessError` gains `FileBusy`, `SymLinkLoop`, and `ReadOnlyFileSystem`. Previously these error codes were all reported as `PermissionDenied`. * Add `std.Target.isDragonFlyBSD`. * stage2: access to the windows_sdk functions is done with a manually maintained .zig binding file instead of `@cImport`. * Update src-self-hosted/libc_installation.zig with all the improvements that stage1 has seen to src/libc_installation.cpp until now. In addition, it now takes advantage of Batch so that evented I/O mode takes advantage of concurrency, but it still works in blocking I/O mode, which is how it is used in stage1.
2020-02-16Implement noasync awaitsAndrew Kelley
Note that there is not yet runtime safety for this. See #3157
2020-02-16fix taking address of temporary async frameAndrew Kelley
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