1287 Commits

Author SHA1 Message Date
r00ster91
6b7d9b34e8 api(std.ascii): remove deprecated decls 2022-12-09 21:57:17 +01:00
Veikka Tuominen
6039554b26 tokenizer: detect null bytes before EOF
Closes #13811
2022-12-08 00:16:30 +02:00
Andrew Kelley
50eb7983cd remove most conditional compilation based on stage1
There are still a few occurrences of "stage1" in the standard library
and self-hosted compiler source, however, these instances need a bit
more careful inspection to ensure no breakage.
2022-12-06 20:38:54 -07:00
Andrew Kelley
b7b905d227 add behavior test for while(true) not needing else unreachable
closes #707
2022-12-06 17:57:27 -07:00
Jakub Konka
5eaacf1ce9 windows: use array of tmp bufs as backing store for input memory to ntdll 2022-12-02 12:24:15 -05:00
Andrew Kelley
ceb0a632cf std.mem.Allocator: allow shrink to fail
closes #13535
2022-11-29 23:30:38 -07:00
Andrew Kelley
b8473ae7d3
Merge pull request #13693 from Vexu/safety
Safety panic improvements & some bug fixes
2022-11-29 19:59:55 -05:00
Jakub Konka
9d0ea0e3f1 arm: implement CPU feature detection by parsing system registers
Also add an incomplete table implementing instruction fusions according
to official optimisation programming manuals.
2022-11-29 19:24:42 +01:00
Jakub Konka
988fff260e windows: map CP 40xx registry values to system ID registers 2022-11-29 19:24:42 +01:00
Jakub Konka
152202da77 windows: if detecting CPU feature set and model fails, use generic with overrides 2022-11-29 19:24:42 +01:00
Veikka Tuominen
34be5784a3 parser: disallow defer and variable declaration as else branch
Closes #13658
2022-11-29 15:47:02 +02:00
Jakub Konka
7bf12b1197 arm: move cpu model table into system/arm.zig
Now we can reuse the table between CPU model parsers on Linux and
Windows.

Use similar parsing structure for Windows as we do for Linux. On
Windows, we rely on two entries in the registry per CPU core:
`CP 4000` and `Identifier`. Collating the data from the two allows
us recreating most of the `/proc/cpuinfo` data natively on Windows.
Additionally, we still allow for overwriting any CPU features as flagged
by pulling the feature data embedded in `SharedUserData`.
2022-11-28 17:07:35 +01:00
Jakub Konka
7fbd2955fa windows: pull QWORD and SZ identifiers from registry in one syscall
At the same time, do not assume the values necessarily exist, and
use defaults as markers for the lack of keys in the registry.
2022-11-28 17:07:34 +01:00
Jakub Konka
d64d7aaac7 windows: drive the registry helper with actual value set for reg entries 2022-11-28 17:07:34 +01:00
Jakub Konka
57bda6524b windows: make registry helper generic over value types 2022-11-28 17:07:34 +01:00
Jakub Konka
49ce86bddf windows: fix logic for pulling info for each core 2022-11-28 17:07:34 +01:00
Jakub Konka
7473ef98e9 windows: implement simplistic CPU model parser 2022-11-28 17:07:34 +01:00
Jakub Konka
7ea2c7fbcd windows: use RtlQueryRegistryValues to query reg in a single syscall 2022-11-28 17:07:34 +01:00
Jakub Konka
e74b6f0a4b windows: detect couple more aarch64 CPU features 2022-11-28 17:07:34 +01:00
Jakub Konka
29aafdcd55 windows: detect native CPU features for aarch64 SoCs 2022-11-28 17:07:34 +01:00
Matt Chudleigh
f61c5f3f52 Bug fix: Prevent uninitialized parse nodes
If a parse node is reserved but never set the node remains
uninitialized and can crash tools doing a linear scan of the nodes
(like ZLS) when switching on the tag.
2022-11-26 18:06:39 +02:00
Veikka Tuominen
8eea73fb92 add tests for tuple declarations 2022-11-23 22:16:31 +02:00
Veikka Tuominen
4cea15f12b std.zig.Ast: simplify usage of tuple_like container fields 2022-11-23 12:13:39 +02:00
Veikka Tuominen
6fb689e97a parser: allow unnamed fields in structs 2022-11-23 12:13:39 +02:00
Andrew Kelley
8c7712d8fa fix CPU model detection for neoverse_n1 on aarch64-linux
see #10086
2022-11-20 15:34:39 -07:00
Stevie Hryciw
04f3067a79 run zig fmt on everything checked by CI 2022-11-18 19:22:42 +00:00
Stevie Hryciw
e999f9f472 std: replace parseAppend with parseWrite in std.zig.string_literal 2022-11-18 19:22:42 +00:00
Stevie Hryciw
ca9e1760e8 fmt: canonicalize identifiers 2022-11-18 19:22:42 +00:00
Jay Petacat
694d8831c3 Revert "x86" CPU model (not arch) back to "i386"
PR #13101 recently renamed the "i386" architecture to "x86", and it
seems the specific CPU model got swept up in that. "x86" is an umbrella
term that describes a family of CPUs, and the "i386" is the oldest
supported model under that umbrella.
2022-11-06 13:39:03 +01:00
Andrew Kelley
1d68045919
Merge pull request #13101 from alichraghi/o4 2022-11-05 02:34:24 -04:00
Veikka Tuominen
8c4faa5f3f
Merge pull request #13338 from Vexu/stage2-compile-errors
Improve some error messages
2022-11-04 16:04:31 +02:00
Ali Chraghi
f5f1f8c666 all: rename i386 to x86 2022-11-04 00:09:27 +03:30
Nathan Bourgeois
e64eef366c
Translate-C Remainder Macro Fix 2022-11-03 14:07:00 +02:00
Jacob Young
771dadc5e0 x86: cleanup inline asm
Multiple outputs work now, so use that instead of deleting clobbers.
2022-11-01 20:39:06 -04:00
Jacob Young
9b2db56d0f x86: remove inline asm clobbers that conflict with inputs or outputs 2022-11-01 20:39:06 -04:00
Veikka Tuominen
278c32976e parser: add helpful error for extra = in variable initializer
Closes #12768
2022-10-29 14:55:43 +03:00
Veikka Tuominen
9607bd90e6 parser: improve error message for missing var/const before local variable
Closes #12721
2022-10-29 14:55:43 +03:00
Evan Haas
c616141241 translate-c: Better support for division in macros
Perform C-style arithmetic conversions on operands to division operator
in macros

Closes #13162
2022-10-28 17:59:32 -04:00
Ali Chraghi
d6943f87f9 NativeTargetInfo: remove unused error 2022-10-28 13:58:28 +02:00
Andrew Kelley
c7772dd694 std.zig.system.NativePaths: avoid calling std.os.getenv on Windows 2022-10-18 16:52:43 -07:00
Veikka Tuominen
71e0ab4ec7 zig fmt: rewrite @maximum and @minimum 2022-10-18 14:16:24 +03:00
dan
ca1c185eb6
std.zig: search include dir and lib dir from environment variables (#13145)
* minor fix based on feedback from @marler8997

Co-authored-by: dan <i@dan.games>
2022-10-16 11:37:35 -04:00
Andrew Kelley
ff534d2267
Merge pull request #12979 from Vexu/inline-switch
Implement inline switch cases
2022-10-03 23:43:09 -04:00
ominitay
295451dfe5
std: Replace use of stage1 function pointers 2022-09-29 21:45:30 +03:00
Veikka Tuominen
0e77259f44 add inline switch union tag captures 2022-09-27 18:33:23 +03:00
Veikka Tuominen
b4d81857f3 stage1+2: parse inline switch cases 2022-09-27 18:05:08 +03:00
Ali Chraghi
0799e98562 std: update NativeTargetInfo.detect doc comments
`detect` doesn't take allocator anymore
2022-09-21 20:14:39 +03:00
Veikka Tuominen
541b3e3a31 Sema: check pointer qualifiers before implicit cast
Closes #12881
2022-09-20 00:50:13 +03:00
Veikka Tuominen
349d78a443 validate number literals in AstGen 2022-09-13 20:26:04 -04:00
Andrew Kelley
37cdb5dbf9 Merge remote-tracking branch 'origin/master' into llvm15 2022-09-09 10:26:17 -07:00