Commit Graph

258 Commits

Author SHA1 Message Date
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
Zachary Raineri
0461a64a93
change uses of std.builtin.Mode to OptimizeMode (#16745)
std.builtin.Mode is deprecated.
2023-08-09 14:39:34 -04:00
Andrew Kelley
acbb6418c3 move docgen.zig to tools/ 2023-07-30 18:44:31 -07:00
Andrew Kelley
48e0b89f2c remove tools/extract-grammar.zig
This is not a sound way to check Zig's grammar against the spec.

This is a partial revert of f8f1c6ac06.
2023-07-25 18:17:18 -07:00
mlugg
f26dda2117 all: migrate code to new cast builtin syntax
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
2023-06-24 16:56:39 -07:00
Andrew Kelley
09c7f1bd7c musl: update libc.S to v1.2.4 2023-06-20 12:55:38 -04:00
Andrew Kelley
cdcfd15d3c musl: deal with zig rename of i386 to x86
musl uses "i386" for this while Zig has switched to "x86".
2023-06-20 12:55:38 -04:00
Eric Joldasov
50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
Josh Wolfe
32cb9462ff
std: Support user-provided jsonParse method. Unify json.Parser and json.parse* (#15705) 2023-06-19 11:21:37 -04:00
r00ster91
6e84f46990 std: replace builtin.Version with SemanticVersion 2023-06-17 13:17:34 -07:00
Jan Philipp Hafer
f043071cdf compiler_rt: add missing PPC routines
Adds conditional exports
- __fixkfti
- __fixunskfti
- __floattikf
- __negkf2
- __mulkc3
- __divkc3
- __powikf2
and adjusts tools/gen_stubs.zig.

From https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html:
"When long double transitions to __float128 on PowerPC in the future,
__ibm128 will remain for use in conversions between the two types."

Hence `__extendkftf2` and `__trunctfkf2` for conversion are superfluous
and only using f128 for `kf` routines is justified.

Closes #16057.
2023-06-16 23:37:50 -07:00
Andrew Kelley
6946a26adc update-linux-headers: add loongarch and xtensa
These operating systems are newly supported by Zig since the last
linux-headers update.
2023-06-15 12:03:25 -07:00
mlugg
4b7c1e5c30 tools: add LLDB pretty printer for InternPool.NullTerminatedString 2023-06-12 18:24:21 -07:00
Jacob Young
3269256965 behavior: fix more compiler crashes 2023-06-10 20:47:56 -07:00
Jacob Young
2d5bc01469 behavior: get more test cases passing with llvm 2023-06-10 20:47:56 -07:00
Jacob Young
f2c716187c InternPool: fix more crashes 2023-06-10 20:47:55 -07:00
Jacob Young
9afa974183 InternPool: fix enough crashes to run build-obj on a simple program 2023-06-10 20:47:55 -07:00
Jacob Young
70cc68e999 Air: remove constant tag
Some uses have been moved to their own tag, the rest use interned.

Also, finish porting comptime mutation to be more InternPool aware.
2023-06-10 20:47:55 -07:00
Jacob Young
6e0de1d116 InternPool: port most of value tags 2023-06-10 20:47:54 -07:00
Jacob Young
a7c3ca3531 InternPool: add lldb pretty printing for indices 2023-06-10 20:47:54 -07:00
Andrew Kelley
629f0d23b5
Merge pull request #15579 from squeek502/mem-delimiters
Split `std.mem.split` and `tokenize` into `sequence`, `any`, and `scalar` versions
2023-06-03 13:51:02 -07:00
Linus Groh
4159add4ab std.fs.file: Rename File.Kind enum values to snake case 2023-05-25 20:17:07 +01:00
Ali Chraghi
3db3cf7790 std.sort: add pdqsort and heapsort 2023-05-23 17:55:59 -07:00
Ryan Liptak
104f4053a2 std.mem: Rename splitFull/tokenizeFull to splitSequence/tokenizeSequence
I think this makes the name less ambiguous and more obvious that the suffix applies to the `delimiter`.
2023-05-13 13:45:05 -07:00
Ryan Liptak
2129f28953 Update all std.mem.split calls to their appropriate function
Everywhere that can now use `splitScalar` should get a nice little performance boost.
2023-05-13 13:45:05 -07:00
Ryan Liptak
815e53b147 Update all std.mem.tokenize calls to their appropriate function
Everywhere that can now use `tokenizeScalar` should get a nice little performance boost.
2023-05-13 13:45:04 -07:00
Josh Wolfe
018b743c7a
std: Rewrite low-level json api to support streaming (#15602) 2023-05-13 14:31:53 -04:00
Andrew Kelley
ceff278202 fixes to the previous commit
* CompileStep: Avoid calling producesPdbFile() to determine whether the
   option should be respected. If the user asks for it, put it on the
   command line and let the Zig CLI deal with it appropriately.
 * Make the namespace of `std.dwarf.Format.dwarf32` no longer have a
   redundant "dwarf" in it.
 * Add `zig cc` integration for `-gdwarf32` and `-gdwarf64`.
 * Toss in a bonus bug fix for `-gdwarf-2`, `-gdwarf-3`, etc.
 * Avoid using default init values for struct fields unnecessarily.
 * Add missing cache hash addition for the new option.
2023-04-20 15:17:07 -07:00
serg
5bc35fa75b std.target.riscv: fix baseline_rv32 missing feature "32bit" 2023-04-18 18:37:15 -07:00
Robin Voetter
700dee34d5
spirv: make IdResultType and IdRef weak aliases of IdResult
Previously they were strong aliases, but as these types are used quite
intermittendly it resulted in a lot of toRef() calls. Removing them
improves readability a bit.
2023-04-09 01:51:51 +02:00
Andrew Kelley
c22a30ac99 zig cc: handle the -r flag
This makes -r treated the same as -c which is to output an object file.
Zig's ELF linker code already handles multiple object files into an
object file with the -r flag to LLD.

closes #11683
2023-04-08 15:48:27 -04:00
Andrew Kelley
f289277599 Merge remote-tracking branch 'origin/master' into llvm16 2023-04-05 22:05:31 -07:00
Jakub Konka
a88c0b4d08 link: handle -u flag in all linkers
Also clean up parsing of linker args - reuse `ArgsIterator`.

In MachO, ensure we add every symbol marked with `-u` as undefined
before proceeding with symbol resolution. Additionally, ensure those
symbols are never garbage collected.

MachO entry_in_dylib test: pass `-u _my_main` when linking executable
so that it is not incorrectly garbage collected by the linker.
2023-04-01 14:22:44 +02:00
Silver
83051b0cbf Update GDB pretty printers 2023-03-30 12:15:53 +03:00
Jacob Young
935ec9ec6a x86_64: canonicalize each br of a block 2023-03-24 17:57:58 -04:00
Andrew Kelley
1ed569e0b2 Merge remote-tracking branch 'origin/master' into llvm16 2023-03-16 17:33:24 -07:00
Jacob Young
8be6073480 tools: fix typo in lldb command 2023-03-15 00:01:44 -04:00
Jacob Young
c29c4c6f70 tools: add lldb pretty printer for std.MultiArrayList.Slice 2023-03-06 05:58:46 -05:00
Andrew Kelley
df4cfc2ecf Merge remote-tracking branch 'origin/master' into llvm16 2023-03-03 12:08:18 -07:00
Jacob Young
57236961e6 tools: revert sharing of stage2 pretty printer info
Partial revert of 1e963053d0. Now that
lldb has a new method for accessing this data that does not require
manual updating, there is no longer any reason to share this data.
2023-02-27 05:37:03 -05:00
Jacob Young
a3529c2dea tools: implement more lldb pretty printers 2023-02-27 05:37:03 -05:00
Andrew Kelley
b5b634e4e8 Merge remote-tracking branch 'origin/master' into llvm16 2023-02-19 10:20:19 -07:00
Andrew Kelley
aeaef8c0ff update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
Andrew Kelley
efdc94c107 Merge remote-tracking branch 'origin/master' into llvm16 2023-02-18 09:33:27 -07:00
Jan Philipp Hafer
e10c0eefde compiler_rt: add __powihf2, __powisf2, __powidf2, __powitf2, __powixf2
Implementation and tests ported from LLVM release 80.
Tests of __powihf2 created from __powisf2 tests with minor adjustments.
2023-02-12 00:10:27 +02:00
matu3ba
d976b4e4a5
compiler_rt: __divmodti4 for libgcc symbol compatibility
- Copy and adjust __divmodsi4 tests for __divmoddi4 and __divmodti4.
- Assuming d = a/b does not overflow (MIN/-1) or uses div by 0,
  then tmp = (d * b) = (a/b * b) = a does not overflow.
  => Remove wraparound for remainder in applicable routines.
2023-02-11 14:41:08 +02:00
matu3ba
1bda8be2a3
compiler_rt: __ashlsi3, __ashrsi3, __lshrsi3 for symbol compatibility
These are unused in LLVM, but in gcc used for example by rl78.
Move test files into common file, add tests for aforementioned routines
and missing ones for __lshrti3.
2023-02-11 14:25:01 +02:00
Stephen Gregoratto
d4ce0fe7fe Update Linux syscall list for 6.1, support Mips64
Follow up for #14541.
2023-02-05 03:25:21 -05:00
ee7
289e8fab79 langref, tools: rename --single-threaded to -fsingle-threaded
Commit 40f5e5dfc6 ("CLI: introduce -fsingle-threaded/
-fno-single-threaded", 2021-12-01) removed the `--single-threaded`
option, but didn't update all mentions of it.

    $ zig version
    0.11.0-dev.1568+c9b957c93
    $ zig build-exe --help | grep single
      -fsingle-threaded         Code assumes there is only one thread
      -fno-single-threaded      Code may not assume there is only one thread
    $ zig build-exe --single-threaded foo.zig
    error: unrecognized parameter: '--single-threaded'
2023-02-04 23:24:07 +02:00