Isaac Freund
9ab4281856
std: remove init functions from linked list nodes
...
These functions are rather useless and redundant as initializing the
struct directly is just as easy:
var node = TailQueue(u32).Node{ .data = 42 };
2020-08-22 02:47:39 -04:00
Andrew Kelley
f18b92ef3a
stage2: implement spilling registers to the stack
2020-08-21 23:36:21 -07:00
Tadeo Kondrak
351701bcad
@Type for Enum fix: use correct decls_scope
2020-08-21 17:45:30 -06:00
Andrew Kelley
f9bd049c89
Merge remote-tracking branch 'origin/master' into llvm11
2020-08-21 14:50:37 -07:00
Tadeo Kondrak
c31e8701d7
Update compile-errors test for @Type(.Enum) changes
2020-08-21 15:00:23 -06:00
Andrew Kelley
dad7af0b37
Merge pull request #6116 from jedisct1/polyfast
...
Make poly1305 faster
2020-08-21 16:52:33 -04:00
Tadeo Kondrak
5a5956bd20
Implement @Type for Enum
2020-08-21 14:31:24 -06:00
Andrew Kelley
89b6c47e04
stage2: decouple codegen.zig from ELF
...
See #6113 for an alternate way of doing this that we didn't end up
following.
Closes #6079 .
I also took the opportunity here to extract C.zig and Elf.zig from
link.zig.
2020-08-21 13:25:59 -07:00
Isaac Freund
37ad9f38dc
std: sync TailQueue with new SinglyLinkedList API
...
The API of SinglyLinkedList was changed in 93384f7, removing the init
function as well as the redundant allocation helper functions.
This commit makes parallel changes to the API of TailQueue in order to
keep the standard library consistent.
2020-08-21 15:59:50 -04:00
Andrew Kelley
a2f1f01e77
Merge branch 'mattnite-bpf-insn'
...
closes #6090
2020-08-21 11:41:25 -07:00
Matt Knight
80fabe1850
fixed bpf namespace
2020-08-21 11:40:35 -07:00
Matt Knight
bc1536f4bf
decided to split up loading of 64-bit immediates
2020-08-21 11:40:35 -07:00
Matt Knight
7f1378909b
moved bpf syscall, added some bpf instructions and tests
2020-08-21 11:40:35 -07:00
Frank Denis
0fe6677736
No need to keep a 128-bit carry around
2020-08-21 20:33:16 +02:00
Frank Denis
2fc2ebd920
Force myself to use unusual integer sizes a little bit more :)
2020-08-21 19:43:06 +02:00
Frank Denis
c9218f1719
Make poly1305 faster
2020-08-21 16:30:52 +02:00
Jakub Konka
243b5c7a88
Add macosx end-to-end smoke test
...
This test case will grow as the linker gets more functionality.
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-21 09:41:05 +02:00
Andrew Kelley
e0a38f7f3e
stage2: make the cache dir if it doesn't already exist
2020-08-20 23:53:34 -07:00
Andrew Kelley
6bbb168f66
Merge branch 'Vexu-stage2'
...
closes #6107
2020-08-20 17:26:05 -07:00
Andrew Kelley
73d16d015e
stage2: reorganize tests
...
The main test cases are now in `test/stage2/test.zig` which can then
call addCases on other files if it wants to organize things differently.
2020-08-20 17:25:09 -07:00
Andrew Kelley
56ea04cb6d
stage2: don't test compile errors of ZIR
2020-08-20 17:19:26 -07:00
Andrew Kelley
7d6d4b1473
stage2: move all tests to compare_output.zig
2020-08-20 17:15:01 -07:00
Andrew Kelley
f54b2e2da6
add missing mutability check in simplePtrType
2020-08-20 17:08:01 -07:00
Vexu
6a053ffcc8
stage2: comptime decl
2020-08-20 16:42:48 -07:00
Vexu
d312d64c9a
stage2: slice types
2020-08-20 16:42:48 -07:00
Vexu
9568248450
stage2: complex pointer types
2020-08-20 16:42:48 -07:00
Vexu
ebfe723f3c
stage2: implement rest of simple pointer types
2020-08-20 16:42:48 -07:00
Frank Denis
eef111fe78
Fix missing init() update in std/build/write_file.zig
2020-08-20 19:21:10 -04:00
Andrew Kelley
21106b9c9f
Merge pull request #6095 from jedisct1/crypto-reorg
...
Breaking: sort std/crypto functions into categories
2020-08-20 19:01:22 -04:00
Frank Denis
3edace34d3
Update tools/process_headers.zig
2020-08-21 00:57:29 +02:00
Frank Denis
fc55cd458a
Hash functions now accept an option set
...
- This avoids having multiple `init()` functions for every combination
of optional parameters
- The API is consistent across all hash functions
- New options can be added later without breaking existing applications.
For example, this is going to come in handy if we implement parallelization
for BLAKE2 and BLAKE3.
- We don't have a mix of snake_case and camelCase functions any more, at
least in the public crypto API
Support for BLAKE2 salt and personalization (more commonly called context)
parameters have been implemented by the way to illustrate this.
2020-08-21 00:51:14 +02:00
Andrew Kelley
9cfcd0c296
Merge pull request #6103 from Vexu/extern
...
Disallow extern variables with initializers.
2020-08-20 18:35:31 -04:00
heidezomp
1ca49b92c6
add UTIME_NOW and UTIME_OMIT constants for use in utimensat/futimens
...
copied from lib/libc/include/generic-musl/sys/stat.h
2020-08-20 17:02:58 -04:00
Frank Denis
adf3d00e87
Remove explicit comptime
2020-08-20 23:02:10 +02:00
Frank Denis
446597bd3c
Remove the reset() function from hash functions
...
Justification:
- reset() is unnecessary; states that have to be reused can be copied
- reset() is error-prone. Copying a previous state prevents forgetting
struct members.
- reset() forces implementation to store sensitive data (key, initial state)
in memory even when they are not needed.
- reset() is confusing as it has a different meaning elsewhere in Zig.
2020-08-20 23:02:10 +02:00
Frank Denis
f92a5d7944
Repair crypto/benchmark; add BLAKE2b256
...
Some MACs have a 64-bit output
2020-08-20 23:02:10 +02:00
Frank Denis
3bed749b1c
Add truncated SHA512 variants
2020-08-20 23:02:10 +02:00
Frank Denis
6f9ea9eaef
Breaking: sort std/crypto functions into categories
...
Instead of having all primitives and constructions share the same namespace,
they are now organized by category and function family.
Types within the same category are expected to share the exact same API.
2020-08-20 23:02:05 +02:00
Andrew Kelley
776bfb0ee6
Merge pull request #6099 from tadeokondrak/@Type(.Struct)
...
Implement @Type for structs
2020-08-20 16:57:10 -04:00
Andrew Kelley
3aeeb21b82
update libunwind to llvm11rc2
2020-08-20 13:36:44 -07:00
Andrew Kelley
1a4059ed88
allow running the stage2 tests in release mode
2020-08-20 13:16:04 -07:00
Andrew Kelley
4a69b11e74
add license header to all std lib files
...
add SPDX license identifier
copyright ownership is zig contributors
2020-08-20 16:07:04 -04:00
Vexu
717e2a365d
correct llvm linkage conversion
...
when weakly exporting external declaration we need to pass LLVMExternalWeakLinkage
2020-08-20 17:12:26 +03:00
Vexu
d25674a51e
disallow extern variables with initializers
2020-08-20 11:35:33 +03:00
Vexu
a553947a51
translate-c: correctly put static and extern local variables in global scope
2020-08-20 10:45:55 +03:00
Jakub Konka
83b0e52079
Merge pull request #6102 from kubkon/macho-pagezero
...
Write page zero as first segment for Mach-O exes
2020-08-20 09:34:33 +02:00
Jakub Konka
ad79b80524
Apply suggestions from code review
...
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2020-08-20 09:14:37 +02:00
Vexu
adc5bce5e8
translate-c: correct translation of global variables
...
* externs with intializers are translated as exports
* non extern without explicit initialization are zero initalized
2020-08-20 10:08:27 +03:00
Jakub Konka
9164daaa39
Write page zero as first segment for Mach-O exes
...
According to the Mach-O file format reference, the first
load command should be a `__PAGEZERO` segment command. The
segment is located at virtual memory location 0, has no protection
rights, and causes acccesses to NULL to immediately crash.
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2020-08-20 08:33:40 +02:00
Andrew Kelley
91de5c212f
Merge branch 'strangebug-fix/std-dbg-warn-hangs-windows'
...
closes #5407
2020-08-19 20:53:32 -07:00