| Age | Commit message (Collapse) | Author |
|
|
|
Deleted 16,000+ lines of c++ code, including:
* an implementation of blake hashing
* the cache hash system
* compiler.cpp
* all the linking code, and everything having to do with building
glibc, musl, and mingw-w64
* much of the stage1 compiler internals got slimmed down since it
now assumes it is always outputting an object file.
More stuff:
* stage1 is now built with a different strategy: we have a tiny
zig0.cpp which is a slimmed down version of what stage1 main.cpp used
to be. Its only purpose is to build stage2 zig code into an object
file, which is then linked by the host build system (cmake) into
stage1. zig0.cpp uses the same C API that stage2 now has access to,
so that stage2 zig code can call into stage1 c++ code.
- stage1.h is
- stage2.h is
- stage1.zig is the main entry point for the Zig/C++
hybrid compiler. It has the functions exported from Zig, called
in C++, and bindings for the functions exported from C++, called
from Zig.
* removed the memory profiling instrumentation from stage1.
Abandon ship!
* Re-added the sections to the README about how to build stage2 and
stage3.
* stage2 now knows as a comptime boolean whether it is being compiled
as part of stage1 or as stage2.
- TODO use this flag to call into stage1 for compiling zig code.
* introduce -fdll-export-fns and -fno-dll-export-fns and clarify
its relationship to link_mode (static/dynamic)
* implement depending on LLVM to detect native target cpu features when
LLVM extensions are enabled and zig lacks CPU feature detection for
that target architecture.
* C importing is broken, will need some stage2 support to function
again.
|
|
|
|
This removes TypeInfo.UnionField.enum_field, which is redundant with
TypeInfo.Union.tag_type.
|
|
Remove deprecated fields on `type`
|
|
Closes #6217
|
|
|
|
ir: Typecheck the sentinel value in *[N:S1]T to [S2]T casts
|
|
|
|
Closes #6054
|
|
|
|
Closes #6153
|
|
|
|
Implement @Type for Enum
|
|
|
|
|
|
|
|
|
|
|
|
This isn't needed with @bitOffsetOf/@byteoffsetOf and complicates
@Type handling.
|
|
stage1: fix non-exhaustive enums with one field
|
|
|
|
|
|
A tagged union cannot legally be initiated to an invalid enumeration
|
|
|
|
|
|
`std.GeneralPurposeAllocator` is now available. It is a function that
takes a configuration struct (with default field values) and returns an
allocator. There is a detailed description of this allocator in the
doc comments at the top of the new file.
The main feature of this allocator is that it is *safe*. It
prevents double-free, use-after-free, and detects leaks.
Some deprecation compile errors are removed.
The Allocator interface gains `old_align` as a new parameter to
`resizeFn`. This is useful to quickly look up allocations.
`std.heap.page_allocator` is improved to use mmap address hints to avoid
obtaining the same virtual address pages when unmapping and mapping
pages. The new general purpose allocator uses the page allocator as its
backing allocator by default.
`std.testing.allocator` is replaced with usage of this new allocator,
which does leak checking, and so the LeakCheckAllocator is retired.
stage1 is improved so that the `@typeInfo` of a pointer has a lazy value
for the alignment of the child type, to avoid false dependency loops
when dealing with pointers to async function frames.
The `std.mem.Allocator` interface is refactored to be in its own file.
`std.Mutex` now exposes the dummy mutex with `std.Mutex.Dummy`.
This allocator is great for debug mode, however it needs some work to
have better performance in release modes. The next step will be setting
up a series of tests in ziglang/gotta-go-fast and then making
improvements to the implementation.
|
|
|
|
This has caused frequent confusion since it looks like you are handling
errors correctly with a try but you forgot to change your return type.
|
|
Add error message for unreachable else prong in switch
|
|
This reverts commit d3ebd428650748e60db70dd2171cc044855814b1.
This caused a build failure on multiple targets.
|
|
This commit makes it possible to obtain pointers to `extern` variables
at comptime.
- `ir_get_var_ptr` employs several checks to determine if the given
variable is eligible for obtaining its pointer at comptime. This
commit alters these checks to consider `extern` variables, which have
runtime values, as eligible.
- After this change, it's now possible for `render_const_val` to be
called for `extern` variables. This commit modifies
`render_const_val` to suppress the value generation for `extern`
variables.
- `do_code_gen` now creates `ZigValue::llvm_global` of `extern`
variables before iterating through module-level variables so that
other module-level variables can refer to them.
This solution is incomplete since there are several cases still
failing:
- `global_var.array[n..m]`
- `&global_var.array[i]`
- `&global_var.inner_struct.value`
- `&global_array[i]`
Closes #5349
|
|
|
|
|
|
Closes #5900
|
|
part of #4335
|
|
|
|
closes #3218
|
|
|
|
|
|
|
|
This reverts commit 2e1bdd0d14f490a80bbed3ee0e0479a908715d33.
Test failures
|
|
Closes #5832
|
|
* Adds error message for types: enum, int and bool
* Adds compile error tests
|
|
@asyncCall now takes arguments as a tuple instead of varargs
|
|
* fix issue #5618
* A test for the issue #5618 added.
Also inserted a comma in the neighboring test to make it more zigfmt-friendly.
|
|
|
|
* Remove have_else_prong (bool)
* Add else_prong (AstNode*)
|
|
|
|
|