Andrew Kelley
c4dddcbadb
std.zig.render: ability to omit variable declarations
2023-11-04 20:26:39 -07:00
Andrew Kelley
88acdb9aa6
zig reduce: delete statements from blocks
2023-11-04 18:06:11 -07:00
Andrew Kelley
31ad3af956
std.zig.render: support fixing unused parameter
2023-11-04 17:37:34 -07:00
Andrew Kelley
fc1e7a5644
zig reduce: rename identifiers when inlining an @import
2023-11-04 15:48:28 -07:00
Andrew Kelley
802c82b072
std.ArrayHashMap: add init function
...
for when you have keys and values array
2023-11-04 15:46:30 -07:00
Andrew Kelley
8bd01d2d9b
zig reduce: add transformation for inlining file-based @import
...
One thing is missing for it to be useful, however, which is dealing with
ambiguous reference errors introduced by the inlining process.
2023-11-04 13:57:29 -07:00
Andrew Kelley
98dc28bbe2
Merge pull request #17852 from ziglang/zig-reduce
...
introduce `zig reduce` subcommand
2023-11-04 14:25:50 -04:00
Jacob Young
095c4294aa
x86_64: fix miscompilations
...
Closes #17618
2023-11-04 09:15:05 -04:00
Andrew Kelley
31529f912b
zig reduce: add transformation of replacing var init with undefined
2023-11-03 22:08:01 -07:00
Andrew Kelley
a2f4adbd19
zig reduce: add "delete unused globals" transform
...
While walking the AST looking for reductions, notice if any globals are
unreferenced, and if they are, add a transformation for removing the
global.
2023-11-03 21:31:32 -07:00
Jacob Young
509be7cf1f
x86_64: fix std test failures
2023-11-03 23:18:21 -04:00
Andrew Kelley
9a1094c00f
fix compilation regression
2023-11-03 20:05:32 -07:00
Andrew Kelley
1396479656
zig reduce: redesign
...
Now it works like this:
1. Walk the AST of the source file looking for independent
reductions and collecting them all into an array list.
2. Randomize the list of transformations. A future enhancement will add
priority weights to the sorting but for now they are completely
shuffled.
3. Apply a subset consisting of 1/2 of the transformations and check for
interestingness.
4. If not interesting, half the subset size again and check again.
5. Repeat until the subset size is 1, then march the transformation
index forward by 1 with each non-interesting attempt.
At any point if a subset of transformations succeeds in producing an interesting
result, restart the whole process, reparsing the AST and re-generating the list
of all possible transformations and shuffling it again.
As for std.zig.render, the fixups operate based on AST Node Index rather
than Nth index of the function occurence. This allows precise control
over how to mutate the input.
2023-11-03 20:05:32 -07:00
Andrew Kelley
dff13e088b
build runner: fix missing newline in error message
2023-11-03 20:05:32 -07:00
Andrew Kelley
09d13104be
std.BitSet: add setAll and unsetAll methods
2023-11-03 20:05:32 -07:00
Andrew Kelley
b1aaf42134
std.zig.render: fix iteration over parameters
...
use the handy iteration API to be correct
2023-11-03 20:05:32 -07:00
Andrew Kelley
5f1f145199
add a transformation for gutting the body of a function
2023-11-03 20:05:32 -07:00
Andrew Kelley
3263d6e6ab
std.zig: move render state to struct; add fixups
2023-11-03 20:05:32 -07:00
dweiller
f6de3ec963
zstandard: fix incorrect RLE decompression into ring buffer
...
This reverts a change introduced in #17400 causing a bug when
decompressing an RLE block into a ring buffer.
RLE blocks contain only a single byte of data to copy into the output,
so attempting to copy a slice causes buffer overruns and incorrect
decompression.
2023-11-03 23:03:43 -04:00
XXIV
b197c4d79b
std.Atomic: remove unnecessary @ptrCast ( #17825 )
2023-11-03 14:55:02 -04:00
xdBronch
5bd27a2cb6
dont assume apple chips are macos exclusive
2023-11-03 14:46:53 -04:00
Ryan Liptak
ae6df9e967
start.zig: Replace kernel32 usage with ntdll
...
Co-authored-by: e4m2 <git@e4m2.com>
2023-11-03 19:25:46 +02:00
Andrew Kelley
94cee4fb27
mingw-w64: add shcore def files
...
these are copied from mingw-w64 v10.0.0
2023-11-02 12:20:09 -07:00
Ryan Liptak
42d4d07efa
start: Make wWinMain nCmdShow setting match Windows better
...
It won't match perfectly; see https://github.com/ziglang/zig/issues/17808
2023-11-02 00:19:40 -04:00
Andrew Kelley
d892665694
Merge pull request #17819 from Luukdegram/wasm-bitcast-fix
...
wasm - fix bitcasting between arrays and scalar types
2023-11-01 20:20:11 -04:00
XXIV
c2cf47ab28
std.os.windows: remove unnecessary @ptrCast ( #17816 )
2023-11-01 18:45:51 -04:00
Luuk de Gram
db1825e931
wasm: re-enable regressed tests
2023-11-01 19:47:15 +01:00
Kai Jellinghaus
7ee7c90274
Fix regressing #17290 from #17734
2023-11-01 18:30:56 +02:00
Jordyfel
61861ef395
std.http: account for renames in docs
2023-11-01 14:46:00 +02:00
Kai Jellinghaus
084a7cf028
Use ArenaAllocator.reset in MemoryPool
2023-11-01 14:45:35 +02:00
Andrew Kelley
3fc6fc6812
std.builtin.Endian: make the tags lower case
...
Let's take this breaking change opportunity to fix the style of this
enum.
2023-10-31 21:37:35 -04:00
Jacob Young
149200aac5
mem: delete readIntSlice and writeIntSlice
...
After deleting all potentially incorrect usages, there were no more
remaining.
2023-10-31 21:37:35 -04:00
Jacob Young
d890e81761
mem: fix ub in writeInt
...
Use inline to vastly simplify the exposed API. This allows a
comptime-known endian parameter to be propogated, making extra functions
for a specific endianness completely unnecessary.
2023-10-31 21:37:35 -04:00
XXIV
46062f1c13
std.fs: remove unnecessary @ptrCast ( #17805 )
2023-10-31 20:15:40 -04:00
Andrew Kelley
8457439a84
Merge pull request #17797 from squeek502/utf16-ascii-fast-path
...
std.unicode: Add ASCII fast path to UTF-16 <-> UTF-8 conversion functions
2023-10-31 13:32:01 -04:00
Ryan Liptak
13c8ec9db0
std.unicode: Add ASCII fast path to UTF-16 -> UTF-8 conversion functions
2023-10-31 02:23:35 -07:00
Ryan Liptak
03117c5290
std.unicode: Add ASCII fast path to UTF-8 -> UTF-16 conversion functions
2023-10-31 02:23:33 -07:00
XXIV
34aac2bae1
std/Thread: remove unnecessary @ptrCast ( #17766 )
2023-10-31 00:17:39 -04:00
Krzysztof Wolicki
1880c799ae
autodoc: Some support for field_call ( #16853 )
...
* autodoc: Some support for field_call
* autodoc: Change handling of field_call to respect tryResolveRefPath, add fieldVal to Expr
* autodoc: Fixed errors
* autodoc: sync with latest master changes
---------
Co-authored-by: Loris Cro <kappaloris@gmail.com>
2023-10-30 21:04:49 +00:00
Karl Seguin
f52a228a5d
Fix http.Headers.initList
...
Use correct return type (error union), cast field length for hashmap capacity.
2023-10-30 20:35:24 +00:00
Jacob Young
f6f2708d82
x86_64: fix compiler rt test failures
2023-10-29 07:20:36 -04:00
Kamil T
37295696ec
std.os.windows additions and fixes
2023-10-29 11:01:54 +02:00
Andrew Kelley
e7ead9c5ea
std: delete psapi, gdi32, and winmm
...
The only remaining Windows APIs now are the ones that the standard
library itself depends on for its cross-platform abstractions.
closes #4426
2023-10-29 00:58:00 -04:00
Jakub Konka
13c7aa5fef
Merge pull request #17727 from ziglang/elf-memory-deferred
...
x86_64+elf: do not pass hardcoded memory addresses in prep for build-obj
2023-10-28 19:41:07 +02:00
Andrew Kelley
d817a3c517
delete std.os.windows.user32
...
This is progress towards #4426
Closes #17417
2023-10-28 13:16:47 -04:00
Andrew Kelley
49b9e1e69b
std.mem.minMax: make it return a tuple
...
this is a breaking change
2023-10-28 10:14:15 -07:00
XXIV
9ff9ea38ea
compiler_rt/emutls: remove unnecessary @ptrCast ( #17755 )
2023-10-28 02:27:58 -04:00
Jacob Young
a440cf6d44
x86_64: fix c abi test failures
2023-10-27 23:31:20 -04:00
Linus Groh
772636ed0d
std.json: Parse -0 as a float instead of an integer ( #17729 )
...
This is consistent with `JSON.parse("-0")` in JavaScript, RFC 8259
doesn't specifically mention what to do in this case.
If a negative zero is encoded the intention is likely to preserve the
sign.
2023-10-27 18:05:51 +00:00
frmdstryr
a4cffd80bd
Update slice_sentinel comment
...
Slice end can be omitted
2023-10-27 18:45:59 +03:00