Commit graph

7159 commits

Author SHA1 Message Date
Jacob Young
a3529c2dea tools: implement more lldb pretty printers 2023-02-27 05:37:03 -05:00
Andrew Kelley
f6c9346773 std.Build.CompileStep.installConfigHeader: add missing step dependency 2023-02-25 23:22:17 -05:00
Andrew Kelley
26196be344 rename std.Build.InstallRawStep to ObjCopyStep
And make it not do any installation, only objcopying. We already have
install steps for doing installation.

This commit also makes ObjCopyStep properly integrate with caching.
2023-02-24 23:48:03 -05:00
Andrew Kelley
6398aabb87
Merge pull request #14713 from jacobly0/cbe-behavior
CBE: fix more behavior tests
2023-02-24 21:23:54 -05:00
Frank Denis
c7f479c3cb
crypto/benchmark.zig: fix pointer capture of non pointer type (#14722) 2023-02-24 19:45:24 +00:00
matu3ba
97b9facb98
compiler_rt: declutter int.zig, add mulXi3 tests (#14623)
- Combine mulXi3 routines for follow-up cleanup.
- DRY up Dwords and Twords
- rename both to HalveInt and use instance
  * Justification: Not all processors have word size 32 bit.
* remove test file from CMakeLists
* DRY things.
2023-02-24 13:27:02 -05:00
Gaëtan S
5f70c36fa8 fix RegQueryValueExW api 2023-02-24 13:22:12 -05:00
Jacob Young
9d24d0354f CBE: fix MSVC diagnostics generated by the behavior tests
After this, the last MSVC warnings are in behavior/bugs/529.zig:
behavior.c(37971): warning C4133: 'function': incompatible types - from 'A__8479 *' to 'A__8474 *'
behavior.c(37974): warning C4133: 'function': incompatible types - from 'A__8480 *' to 'A__8474 *'
2023-02-23 20:30:59 -05:00
Jacob Young
a0d7fd162b CBE: support call attributes
* Support always_tail and never_tail/never_inline with a comptime callee using clang
 * Support never_inline using gcc
 * Support never_inline using msvc

Unfortunately, can't enable behavior tests because of the conditional support.
2023-02-23 10:54:26 -05:00
Jacob Young
57f6adf85d CBE: implement c varargs
Removed some backend test skip checks for things disabled in std.
2023-02-23 01:21:59 -05:00
Andrew Kelley
d3c9bfada6 std.Build.WriteFileStep: integrate with cache system
And additionally support writing files to source files. This means a
custom build step in zig's own build.zig is no longer needed for copying
zig.h because it is handled by WriteFileStep.
2023-02-23 01:08:23 -05:00
Andrew Kelley
c9e02d3e69
Merge pull request #14691 from jacobly0/ctype 2023-02-22 11:06:13 -05:00
Jacob Young
248fb40dcc CBE: fix windows test failures 2023-02-21 15:46:34 -05:00
Andrew Kelley
b52be973df
Merge pull request #14394 from dweiller/zstandard
Zstandard decompressor
2023-02-21 13:59:14 -05:00
Alexis Brodeur
98dd041d53 Relax std.sort.binarySearch requirements
Forcing the key to be of the same type as the sorted items used during
the search is a valid use case.

There, however, exists some cases where the key and the items are of
heterogeneous types, like searching for a code point in ordered ranges
of code points:

```zig
const CodePoint = u21;
const CodePointRange = [2]CodePoint;

const valid_ranges = &[_]CodePointRange{
    // an ordered array of ranges
};

fn orderCodePointAndRange(
    context: void,
    code_point: CodePoint,
    range: CodePointRange
) std.math.Order {
    _ = context;
    if (code_point < range[0]) {
        return .lt;
    }
    if (code_point > range[1]) {
        return .gt;
    }
    return .eq;
}

fn isValidCodePoint(code_point: CodePoint) bool {
    return std.sort.binarySearch(
        CodePointRange,
        code_point,
        valid_ranges,
        void,
        orderCodePointAndRange
    ) != null;
}
```

It is so expected that `std.sort.binarySearch` should therefore support
both homogeneous and heterogeneous keys.
2023-02-21 12:28:43 -05:00
Komari Spaghetti
2737dce84f
Introduce ChildProcess.collectOutput (#12295)
All the code for this function already exists, but only
ChildProcess.exec was allowed to use the code.
2023-02-21 12:26:55 -05:00
dweiller
765a6d3413 std.compress.zstd: renamed from std.compress.zstandard 2023-02-22 00:11:20 +11:00
dweiller
32cf1d7cbf std.compress.zstandard: fix error sets for streaming API 2023-02-21 22:06:25 +11:00
Jacob Young
25a3c933b9 CBE: fix test failures 2023-02-21 02:32:49 -05:00
Jacob Young
828ac637b2 MultiArrayList: delete pessimizing vector usage
By factoring out the comptime parts of this computation, vectors are no
longer useful in this function.
2023-02-21 00:27:12 -05:00
Jacob Young
b76fed8206 zig.h: get no int128 path working on non-msvc 2023-02-21 00:27:12 -05:00
Jacob Young
1a1598daf0 hash map: remove extra argument 2023-02-21 00:27:12 -05:00
Jacob Young
3eed197c95 CBE: use stdint.h types instead of zig_ prefixes
This requires manual defines before C99 which may not have stdint.h.

Also have update-zig1 leave a copy of lib/zig.h in stage1/zig.h, which
allows lib/zig.h to be updated without needing to update zig1.wasm.
Note that since the object already existed with the exact same contents,
this completely avoids repo bloat due to zig.h changes.
2023-02-20 23:59:48 -05:00
dweiller
c6ef83efe5 std.compress.zstandard: clean up streaming API 2023-02-21 14:53:02 +11:00
mlugg
09a84c8384
Update std.Build to new module CLI, update zig1 and CMakeLists
Resolves: #14667
2023-02-21 01:59:37 +00:00
dweiller
c7c35bf9e6 std.RingBuffer: add (non-concurrent) RingBuffer implementation 2023-02-21 12:58:34 +11:00
dweiller
1c518bd993 std.compress.zstandard: rename ZStandardStream -> DecompressStream 2023-02-21 12:58:27 +11:00
dweiller
12d9f73ce8 std.compress.zstandard: remove use of usingnamespace 2023-02-21 12:09:27 +11:00
dweiller
a34c2de7bc std.hash: use std.math.rotl in Xxhash64 and Xxhash32 2023-02-21 12:09:27 +11:00
Frank Denis
6214f66dc1 trim(Left|Right): clarify that values_to_strip is a set
The parameter could be confused with a prefix or suffix, instead
of a set of values.
2023-02-20 13:55:45 -05:00
Loris Cro
99c11cc8cf
Merge pull request #14544 from der-teufel-programming/autodoc-quickfixes
autodoc: main.js cleanup and formatting
2023-02-20 16:37:41 +01:00
Loris Cro
dfd182cc7a
Merge pull request #14655 from McSinyx/md-ol
autodoc: fix markdown list rendering
2023-02-20 16:33:00 +01:00
dweiller
a74f800dd7 std.compress.zstandard: update for multi-for-loop change 2023-02-20 16:58:48 +11:00
dweiller
2766b704c1 std.compress.zstandard: add DictionaryIdFlagUnsupported ZstandardStream.Error 2023-02-20 09:09:06 +11:00
dweiller
1a862175d5 std.compress.zstandard: fix zstandardStream content size validation 2023-02-20 09:09:06 +11:00
dweiller
12aa478db0 std.compress.zstandard: also check block size when sequence count is 0 2023-02-20 09:09:06 +11:00
dweiller
a53cf299a6 std.compress.zstandard: add error condition to ring buffer decoding
Previously `executeSequenceRingBuffer()` would not verify the offset
against the number of bytes already decoded, so it would happily copy
garbage bytes rather than return an error before the window was filled.

To fix this a new `written_count` is added to the decode state that
tracks the total number of bytes decoded.
2023-02-20 09:09:06 +11:00
dweiller
5a31fc2014 std.compress.zstandard: fix erroneous literal stream empty checks 2023-02-20 09:09:06 +11:00
dweiller
8fd41314bd std.compress.zstandard: remove unneeded branch 2023-02-20 09:09:06 +11:00
dweiller
476d2fe1fa std.compress.zstandard: fix zstandardStream finishing early 2023-02-20 09:09:06 +11:00
dweiller
373d8ef26e std.compress.zstandard: check FSE bitstreams are fully consumed 2023-02-20 09:09:06 +11:00
dweiller
1530e73648 std.compress.zstandard: bytes read assert to error in decodeBlockReader 2023-02-20 09:09:06 +11:00
dweiller
ee5af3c74c std.compress.zstandard: cleanup high-level api docs and error sets 2023-02-20 09:09:06 +11:00
dweiller
31cc4605ab std.compress.zstandard: fix errors and crashes in ZstandardStream 2023-02-20 09:09:06 +11:00
dweiller
55e6e9409c std.compress.zstandard: fix content size check 2023-02-20 09:09:06 +11:00
dweiller
6d48b055af std.compress.zstandard: add decodeFrameHeader
Also do some other minor API cleanup
2023-02-20 09:09:06 +11:00
dweiller
3975a9d7ca std.compress.zstandard: error when FSE bitstream is no fully consumed 2023-02-20 09:09:06 +11:00
dweiller
77ca1f7859 std.compress.zstandard: remove UnusedBitSet error 2023-02-20 09:09:06 +11:00
dweiller
d9a90e1818 std.compress.zstandard: fix decodeAlloc() and remove decodeFrameAlloc() 2023-02-20 09:09:06 +11:00
dweiller
2134769436 std.compress.zstandard: validate skippable frame size 2023-02-20 09:09:06 +11:00