| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.
This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
|
|
|
|
|
|
* Introduce `-Ddebug-extensions` for enabling compiler debug helpers
* Replace safety mode checks with `std.debug.runtime_safety`
* Replace debugger helper checks with `!builtin.strip_debug_info`
Sometimes, you just have to debug optimized compilers...
|
|
|
|
|
|
Closes #17618
|
|
* implement vector comparison
* implement reduce for bool vectors
* fix `@memcpy` bug
* enable passing std tests
|
|
This reverts commit 6f0198cadbe29294f2bf3153a27beebd64377566.
|
|
This reverts commit 0c99ba1eab63865592bb084feb271cd4e4b0357e, reversing
changes made to 5f92b070bf284f1493b1b5d433dd3adde2f46727.
This caused a CI failure when it landed in master branch due to a
128-bit `@byteSwap` in std.mem.
|
|
|
|
closes #17426
|
|
closes #10618
solved by #17172
|
|
|
|
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:
* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
|
|
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
|
|
The idea here is that there are two ways we can reference a function at runtime:
* Through a direct call, i.e. where the function is comptime-known
* Through a function pointer
This means we can easily perform a form of rudimentary escape analysis
on functions. If we ever see a `decl_ref` or `ref` of a function, we
have a function pointer, which could "leak" into runtime code, so we
emit the function; but for a plain `decl_val`, there's no need to.
This change means that `comptime { _ = f; }` no longer forces a function
to be emitted, which was used for some things (mainly tests). These use
sites have been replaced with `_ = &f;`, which still triggers analysis
of the function body, since you're taking a pointer to the function.
Resolves: #6256
Resolves: #15353
|
|
|
|
|
|
Now they use slices or array pointers with any element type instead of
requiring byte pointers.
This is a breaking enhancement to the language.
The safety check for overlapping pointers will be implemented in a
future commit.
closes #14040
|
|
|
|
|
|
|
|
|
|
|
|
By factoring out the comptime parts of this computation, vectors are no
longer useful in this function.
|
|
|
|
|
|
There are still a few occurrences of "stage1" in the standard library
and self-hosted compiler source, however, these instances need a bit
more careful inspection to ensure no breakage.
|
|
closes #13535
|
|
Vectors are not yet implemented in the C backend, so no reason to
prevent code using the standard library from compiling in the meantime.
|
|
See #3811
|
|
The miscompilation in question has been fixed upstream in LLVM 13.
closes #8117
|
|
Adds error for taking a non comptime parameter in a function returning a
comptime-only type but not when that type is dependent on a parameter.
Co-authored-by: Veikka Tuominen <git@vexu.eu>
|
|
Update basic usage test to account for these, and by extension for addOneAssumeCapacity.
|
|
Ever since a semi-recent language specification update, pointers to
zero-sized types still have runtime bits.
|
|
|
|
|
|
This also adds `std.sort.sortContext` and
`std.sort.insertionSortContext` which are more advanced methods that
allow overriding the `swap` method. The former calls the latter for now
because reworking the main sort implementation is a big task that can be
done later without any changes to the API.
|
|
This reverts commit 1f10cf4edf2b645e63dedc42f5d7475914bf2311.
Re-opens #10618
I want to solve this a different way. `align(S)` where S is a 0-byte
type should work in this context.
This also caused issues such as
https://github.com/Vexu/arocc/issues/221
|
|
Also fixes error with ArrayHashMap when both key and value are 0 sized
|
|
|
|
Calling `insert` on a `std.MultiArrayList` currently fails with a compiler error due to using a `try` without the `!` annotation on the return type
```zig
this.list.insert(allocator, 0, listener);
```
```zig
/Users/jarred/Build/zig/lib/std/multi_array_list.zig:192:13: error: expected type 'void', found '@typeInfo(@typeInfo(@TypeOf(std.multi_array_list.MultiArrayList(src.javascript.jsc.node.types.Listener).ensureUnusedCapacity)).Fn.return_type.?).ErrorUnion.error_set'
try self.ensureUnusedCapacity(gpa, 1);
```
|
|
|
|
See #3811
|
|
|
|
|