Commit Graph

306 Commits

Author SHA1 Message Date
Andrew Kelley
f47824f24d std: restructure child process namespace 2024-05-26 09:31:55 -07:00
Andrew Kelley
21f1e76efe zig cc: update clang CLI data to LLVM 18
release/18.x branch, commit 78b99c73ee4b96fe9ce0e294d4632326afb2db42
2024-05-08 19:37:28 -07:00
Andrew Kelley
109ec72924 update CPU features to LLVM 18
release/18.x branch, commit 78b99c73ee4b96fe9ce0e294d4632326afb2db42
2024-05-08 19:37:28 -07:00
Ryan Liptak
b86c4bde64 Rename Dir.writeFile2 -> Dir.writeFile and update all callsites
writeFile was deprecated in favor of writeFile2 in f645022d16. This commit renames writeFile2 to writeFile and makes writeFile2 a compile error.
2024-05-03 13:29:22 -07:00
Marc Tiehuis
ef5618fcd5 std.hash.crc: simplify api
This removes the two original implementations in favour of the single
generic one based on the Algorithm type. Previously we had three, very
similar implementations which was somewhat confusing when knowing what
one should actually be used.

The previous polynomials all have equivalent variants available when
using the Algorithm type.
2024-04-28 21:12:01 +12:00
Andrew Kelley
1b90888f57 migrate langref documentation generation to the build system 2024-04-25 00:09:24 -07:00
Travis Staloch
8af59d1f98 ComptimeStringMap: return a regular struct and optimize
this patch renames ComptimeStringMap to StaticStringMap, makes it
accept only a single type parameter, and return a known struct type
instead of an anonymous struct.  initial motivation for these changes
was to reduce the 'very long type names' issue described here
https://github.com/ziglang/zig/pull/19682.

this breaks the previous API.  users will now need to write:
`const map = std.StaticStringMap(T).initComptime(kvs_list);`

* move `kvs_list` param from type param to an `initComptime()` param
* new public methods
  * `keys()`, `values()` helpers
  * `init(allocator)`, `deinit(allocator)` for runtime data
  * `getLongestPrefix(str)`, `getLongestPrefixIndex(str)` - i'm not sure
     these belong but have left in for now incase they are deemed useful
* performance notes:
  * i posted some benchmarking results here:
    https://github.com/travisstaloch/comptime-string-map-revised/issues/1
  * i noticed a speedup reducing the size of the struct from 48 to 32
    bytes and thus use u32s instead of usize for all length fields
  * i noticed speedup storing KVs as a struct of arrays
  * latest benchmark shows these wall_time improvements for
    debug/safe/small/fast builds: -6.6% / -10.2% / -19.1% / -8.9%. full
    output in link above.
2024-04-22 15:31:41 -07:00
Brandon Black
271d896446 std.hash.crc: get rid of usingnamespace
This flips things around such that std/hash/crc.zig is generated
by the catalog-based generation tool, and the real code that used
to be in that file is moved out to std/hash/crc/impl.zig.  The
generated tests are moved to std/hash/crc/test.zig.  By going this
route, we eliminate the need for usingnamespace without changing
anything for callers of these interfaces.  The Crc32 tests are
simply added to the fixed part of the generated output and
compactified a bit.

This was the second-to-last usage of usingnamespace left in std.
2024-04-11 14:42:04 -07:00
Carl Åstholm
4c393c7468 Update usages of fmtId/isValidId
`{}` for decls
`{p}` for enum fields
`{p_}` for struct fields and in contexts following a `.`

Elsewhere, `{p}` was used since it's equivalent to the old behavior.
2024-04-07 14:47:11 +02:00
Jacob Young
5a41704f7e cbe: rewrite CType
Closes #14904
2024-03-30 20:50:48 -04:00
Elaine Gibson
add74427b9 mingw: support -municode 2024-03-27 10:05:57 +00:00
Andrew Kelley
869c2a03f3 mingw-w64 updater: don't include windowsapp or onecore APIs 2024-03-20 11:25:54 -07:00
Andrew Kelley
43f240803d mingw-w64 updater: don't omit win32 def files
see #18968
2024-03-20 11:23:48 -07:00
Robin Voetter
9b18125562
spirv: make generic globals invocation-local 2024-03-18 19:13:50 +01:00
Robin Voetter
20d7bb68ac
spirv: add zig-specific ext inst
This may be removed again in the future...
2024-03-18 19:13:49 +01:00
Robin Voetter
e566158acf
spirv: make IdResult an enum 2024-03-18 19:13:49 +01:00
Robin Voetter
3d5721da23
spirv: update spec generator
For module parsing and assembling, we will also need to know
all of the SPIR-V extensions and their instructions. This commit
updates the generator to generate those. Because there are
multiple instruction sets that each have a separate list of Opcodes,
no separate enum is generated for these opcodes. Additionally, the
previous mechanism for runtime instruction information, `Opcode`'s
`fn operands()`, has been removed in favor for
`InstructionSet.core.instructions()`.

Any mapping from operand to instruction is to be done at runtime.
Using a runtime populated hashmap should also be more efficient
than the previous mechanism using `stringToEnum`.
2024-03-18 19:13:46 +01:00
Ahmed
5c8eda36d6 chore: Fix some typos 2024-03-14 19:43:24 +02:00
Tristan Ross
9d70d614ae
std.builtin: make link mode fields lowercase 2024-03-11 07:09:10 -07:00
Jacob Young
136d7c2138 tools: add lldb pretty printer for stage2 inst indices 2024-03-02 01:06:58 +01:00
Ali Chraghi
afa7793351 spirv: basic shader support 2024-02-05 11:55:14 +03:30
Jakub Konka
92deebcd66 cli+build: handle -ObjC flag and route it to MachO linker 2024-02-02 22:00:16 +01:00
Andrew Kelley
9be831e15a langref: remove line numbers from code samples
It's unnecessary, more complicated, bloated, and it messes up the table
of operators.
2024-01-21 20:31:13 -07:00
Elaine Gibson
b126978555 mingw-w64: remove msvcrt sources 2024-01-20 00:21:34 +00:00
F3real
1322049e24 Don't crash or CR/LF line endings in docgen 2024-01-13 22:05:09 -08:00
Carl Åstholm
f2dfd7d212 Override incorrect ARM Cortex-M series CPU feature definitions
Based on the Arm Cortex-M Processor Comparison Table v3.0
<https://developer.arm.com/documentation/102787/0300/?lang=en>
2024-01-09 17:53:18 +01:00
Carl Åstholm
55f2a6684e update_cpu_features: Support omitting deps 2024-01-09 17:53:09 +01:00
Andrew Kelley
089ebeb873 update-mingw tool: add config.h to whitelist 2024-01-08 11:52:38 -07:00
Andrew Kelley
491b460e0a add tool for updating mingw crt files 2024-01-08 11:52:38 -07:00
Andrew Kelley
3f6e651d5a remove tool: update-license-headers
This tool is not needed since license headers were removed in
d29871977f.
2024-01-07 17:02:17 -07:00
Andrew Kelley
f5613a0e35 update docgen for std Target.Query API breaks 2024-01-01 17:51:18 -07:00
David Rubin
1e42a3de89
Remove all usages of std.mem.copy and remove std.mem.set (#18143) 2023-11-29 16:03:02 -05:00
Andrew Kelley
e357550610 update for the std.fs.Dir changes 2023-11-22 15:24:57 -07:00
Andrew Kelley
519ba9bb65 Revert "Merge pull request #12060 from Vexu/IterableDir"
This reverts commit da94227f78, reversing
changes made to 8f943b3d33.

I was against this change originally, but decided to approve it to keep
an open mind. After a year of trying it in practice, I firmly believe
that the previous way of doing it was better.
2023-11-22 12:35:33 -07:00
Andrew Kelley
ddd8d59188 tools/gen_spirv_spec: fix wrong use of BoundedArray
It incorrectly, was returning an error, when it actually wanted to
assert that the array bounds were not exceeded. Fixed by using ArrayList
instead.
2023-11-22 11:33:34 -07:00
mlugg
026a8278f8
tools: correct unnecessary uses of 'var' 2023-11-19 09:57:04 +00: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
27fe945a00 Revert "Revert "Merge pull request #17637 from jacobly0/x86_64-test-std""
This reverts commit 6f0198cadb.
2023-10-22 15:46:43 -04:00
Andrew Kelley
6f0198cadb Revert "Merge pull request #17637 from jacobly0/x86_64-test-std"
This reverts commit 0c99ba1eab, reversing
changes made to 5f92b070bf.

This caused a CI failure when it landed in master branch due to a
128-bit `@byteSwap` in std.mem.
2023-10-22 12:16:35 -07:00
Jan Philipp Hafer
fd2239bde9 child_process + Build: rename exec to run + all related code
Justification: exec, execv etc are unix concepts and portable version
should be called differently.

Do no touch non-Zig code. Adjust error names as well, if associated.
Closes #5853.
2023-10-22 14:47:20 -04:00
Jacob Young
2e6e39a700 x86_64: fix bugs and disable erroring tests 2023-10-21 10:55:41 -04:00
Andrew Kelley
0813539c28 it's unclear which zig target glibc sparcv9 maps to
so let's not include those headers until more investigation happens.
2023-10-13 17:44:27 -07:00
Andrew Kelley
87b3e23172 tools/update_glibc: exempt some more files 2023-10-13 17:44:27 -07:00
Jakub Konka
91ef6d1173 docgen: update use of getExternalExecutor 2023-10-06 16:04:57 +02:00
Jakub Konka
8b4e3b6aee comp: add support for -fdata-sections 2023-10-04 11:21:56 -07:00
Stephen Gregoratto
11fcbe5a46 gen_linux_syscalls: use default max output bytes
Apparently, 20KiB is not enough anymore.
2023-09-28 18:58:05 +10:00
Andrew Kelley
62a12e0631 LLVM 17 std lib updates and fixes
* some manual fixes to generated CPU features code. in the future it
   would be nice to make the script do those automatically. I suspect
   the sm_90a thing is a bug in LLVM.
 * add liteos to various target OS switches. I know nothing about this
   OS; someone will need to work specifically on support for this OS
   when the time comes to support it properly in zig.
 * while waiting for the compiler, I went ahead and made more
   conservative choices about when to use `inline` in std/Target.zig
2023-09-19 09:37:31 -07:00
Andrew Kelley
3ed40b1140 update CPU features to LLVM 17
release/17.x branch, commit 8f4dd44097c9ae25dd203d5ac87f3b48f854bba8
2023-09-19 09:37:31 -07:00
Marc Tiehuis
f056e01c23 update crc catalog gen script 2023-09-06 16:43:57 +12:00
Jacob Young
8b9161179d Sema: avoid deleting runtime side-effects in comptime initializers
Closes #16744
2023-08-11 11:01:47 -07:00