Veikka Tuominen
2a3f3766a4
stage2: handle parser notes in a more general way
2022-07-12 12:50:59 +03:00
Veikka Tuominen
5d22204d2d
parser: add helpful error for C style container declarations
...
```zig
// a.zig
struct Foo {
a: u32,
};
```
before:
```
a.zig:1:1: error: expected test, comptime, var decl, or container field, found 'struct'
struct Foo {
^
```
after:
```
a.zig:1:8: error: 'struct Foo' is invalid
struct Foo {
^
a.zig:1:8: note: to declare a container do 'const Foo = struct'
struct Foo {
^
```
2022-07-12 12:50:59 +03:00
Andrew Kelley
7d2e142679
Merge pull request #12044 from Vexu/stage2-compile-errors
...
Sema: add detailed error notes to `coerceInMemoryAllowed`
2022-07-11 20:45:27 -04:00
Andrew Kelley
dc815e5e8f
Merge pull request #12075 from Vexu/stage2-validate-extern
...
Stage2 validate extern types
2022-07-11 20:25:35 -04:00
Andrew Kelley
8b3f15f218
Merge pull request #11863 from motiejus/compress-debug-sections
...
ELF: understand --compress-debug-sections
2022-07-11 17:23:02 -04:00
Andrew Kelley
2b99182e25
stage2: cleanups to --compress-debug-sections
...
* make the setting in the linker backend be non-optional; by this time
all defaults are supposed to be resolved.
* integrate with `zig cc`
* change the CLI parsing to match C compiler parsing, allowing
`--compress-debug-sections` alone to choose a default encoding of
zlib.
2022-07-11 14:18:56 -07:00
r00ster91
da75eb0d79
Compilation: indent multiline error messages properly
...
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-07-12 00:10:39 +03:00
Motiejus Jakštys
1f410b500c
ELF: understand -Wl,--compress-debug-sections
...
This argument is both a compiler and a linker flag. The linker flag was
not understood; now it is. Go likes to use it as a linker flag.
Tested with sqlite3. The size difference is significant, and I confirmed
gdb understands both binaries.
zlib: 3.66MB
------------
CC="zig cc"
CFLAGS="-Wl,--compress-debug-sections=zlib -O2"
./configure --disable-tcl
make
FILE SIZE VM SIZE
-------------- --------------
39.1% 1.43Mi 88.4% 1.43Mi .text
19.6% 734Ki 0.0% 0 .debug_info
16.4% 613Ki 0.0% 0 .debug_loc
13.1% 492Ki 0.0% 0 .debug_line
4.2% 157Ki 9.5% 157Ki .rodata
2.3% 87.6Ki 0.0% 0 .debug_ranges
1.5% 56.2Ki 0.0% 0 .symtab
1.1% 40.2Ki 0.0% 0 .strtab
1.0% 38.2Ki 0.0% 0 .debug_str
0.7% 26.2Ki 0.0% 0 .debug_frame
0.4% 15.3Ki 0.9% 15.3Ki .data
0.1% 4.71Ki 0.3% 4.71Ki .dynsym
0.1% 3.65Ki 0.2% 3.26Ki [16 Others]
0.1% 2.55Ki 0.2% 2.55Ki .rela.plt
0.1% 2.12Ki 0.0% 0 [ELF Section Headers]
0.0% 0 0.1% 2.02Ki .bss
0.0% 1.84Ki 0.1% 1.84Ki .dynstr
0.0% 1.72Ki 0.1% 1.72Ki .plt
0.0% 1.58Ki 0.1% 1.58Ki .hash
0.0% 1.17Ki 0.0% 0 .debug_abbrev
0.0% 1.01Ki 0.1% 1.01Ki .rela.dyn
100.0% 3.66Mi 100.0% 1.62Mi TOTAL
none: 8.56MB
------------
CC="zig cc" CFLAGS="-O2" ./configure --disable-tcl
make
FILE SIZE VM SIZE
-------------- --------------
41.1% 3.52Mi 0.0% 0 .debug_loc
18.5% 1.59Mi 0.0% 0 .debug_info
16.7% 1.43Mi 88.4% 1.43Mi .text
11.8% 1.01Mi 0.0% 0 .debug_line
5.9% 515Ki 0.0% 0 .debug_ranges
1.8% 157Ki 9.5% 157Ki .rodata
1.3% 118Ki 0.0% 0 .debug_frame
1.3% 110Ki 0.0% 0 .debug_str
0.6% 56.2Ki 0.0% 0 .symtab
0.5% 40.2Ki 0.0% 0 .strtab
0.2% 15.3Ki 0.9% 15.3Ki .data
0.1% 4.71Ki 0.3% 4.71Ki .dynsym
0.0% 3.64Ki 0.2% 3.26Ki [16 Others]
0.0% 2.98Ki 0.0% 0 .debug_abbrev
0.0% 2.55Ki 0.2% 2.55Ki .rela.plt
0.0% 2.12Ki 0.0% 0 [ELF Section Headers]
0.0% 0 0.1% 2.02Ki .bss
0.0% 1.84Ki 0.1% 1.84Ki .dynstr
0.0% 1.72Ki 0.1% 1.72Ki .plt
0.0% 1.58Ki 0.1% 1.58Ki .hash
0.0% 1.01Ki 0.1% 1.01Ki .rela.dyn
100.0% 8.56Mi 100.0% 1.62Mi TOTAL
2022-07-11 13:55:29 -07:00
Veikka Tuominen
122c76a167
Sema: allow void as an extern union field & fix invalid extern unions
2022-07-11 20:30:16 +03:00
Ikko Ashimine
ade9bd9287
stage1: fix typo in analyze.cpp ( #12077 )
...
accomodate -> accommodate
2022-07-11 18:30:28 +02:00
Veikka Tuominen
d00da05ecb
Sema: validate extern types
2022-07-11 18:47:29 +03:00
Veikka Tuominen
3ceb27c840
Sema: better explanation why opaque types require comptime
2022-07-11 18:47:29 +03:00
Veikka Tuominen
20d4f7213d
Sema: add notes about function return type
2022-07-11 17:55:19 +03:00
frmdstryr
3e2e6c108a
std.math: add degreesToRadians and radiansToDegrees
2022-07-11 16:40:05 +03:00
Veikka Tuominen
c9e1360cdb
Sema: add "cannot convert to payload type" error notes
2022-07-11 14:17:22 +03:00
Veikka Tuominen
2a41b1449b
Compilation: do not repeat AstGen error source line for notes
2022-07-11 14:16:42 +03:00
Veikka Tuominen
0370006c1f
Sema: only add note about int mismatch if not coercible
...
`unsigned 64-bit int cannot represent all possible unsigned 63-bit values`
is nonsensical.
2022-07-11 11:59:26 +03:00
Mikko Kaihlavirta
6f55b294f6
use std.log for logging
2022-07-11 11:18:52 +03:00
Duncan Holm
4bbc95b219
std.fmt: clarify the description of placeholders in Format Strings
...
Those 6 sets of square brackets are just a typographical aid used in this doc-comment, and must not actually be written by the user in their own format string... except for in one case where they must
* Avoid the implication that the numeric index is 1-based rather than 0-based
2022-07-11 11:16:28 +03:00
Andrew Kelley
76c89a3de9
Merge pull request #12071 from topolarity/windows-abi-change
...
compiler_rt: Update Windows ABI for float<->int conversion routines
2022-07-10 23:53:14 -04:00
Cody Tapscott
2b5215436c
stage2: Lower libcalls on Windows x86-64 correctly
...
This change is the Zig counterpart to https://reviews.llvm.org/D110413
Same as the prior commit, but for stage2
2022-07-10 20:52:29 -07:00
Cody Tapscott
d182e2ebda
stage1: Lower libcalls on Windows x86-64 correctly
...
This change is the Zig counterpart to https://reviews.llvm.org/D110413
Since we lower some libcalls directly (just like clang does), we need to
make sure that the ABI we call with matches the ABI of the compiler-rt
we are providing (and also the ABI expected by LLVM).
While I was at it, I noticed some flawed vector handling in the binary
soft float ops in stage 1, so I shored up the logic a bit and expanded
an existing test to cover the missing functionality.
2022-07-10 20:52:28 -07:00
Cody Tapscott
bb8971150c
compiler_rt: Slightly re-factor exports for Windows x86-64
...
This is just a cosmetic change. The goal is to keep the export logic
relatively flat and centralized.
2022-07-10 20:51:34 -07:00
Cody Tapscott
680419c407
compiler_rt: Update Windows ABI for float<->int conversion routines
...
Starting with LLVM 14, the Libcalls to these functions are now lowered
using a Vec(2, u64) instead of the standard ABI for i128 integers, so
our compiler-rt implementation needs to be updated to expose the same
ABI on Windows.
2022-07-10 20:51:34 -07:00
Frank Denis
f3333a56e8
stage1/codegen: replace sprintf() with snprintf()
...
Calling sprintf() is now triggering an error on Xcode 14.
Using snprintf() is generally not a bad idea anyway.
2022-07-10 22:59:25 -04:00
Veikka Tuominen
e644a2ab6a
Compilation: do not repeat same source line for notes
2022-07-10 23:47:56 +03:00
Veikka Tuominen
34fe2b4f4b
Sema: prefer original error message in coerce
2022-07-10 23:47:56 +03:00
Veikka Tuominen
b9f01bc394
Sema: add detailed error notes to coerceInMemoryAllowed
2022-07-10 23:15:17 +03:00
BratishkaErik
b9ed072278
CMakeLists.txt: set LLVM minimal version to 14
2022-07-10 15:43:01 -04:00
Andrew Kelley
b88151e0e1
Merge pull request #12001 from ziglang/llvm14
...
Upgrade to LLVM 14
2022-07-10 03:06:05 -04:00
Andrew Kelley
f9bf488926
two more regressed test cases; same cause as last two commits
2022-07-09 17:35:14 -07:00
Andrew Kelley
31281a7d14
disable regressed math.sign test case
...
see #12012
2022-07-09 15:43:33 -07:00
Andrew Kelley
321fec1aa6
disable regressed float formatting test case
...
See #12063
2022-07-09 15:34:34 -07:00
Andrew Kelley
4d10fbef10
windows_com: add missing __CRT_UUID_DECL() for IEnumSetupInstances
...
This is intended to fix this error:
lld-link: error: undefined symbol: _GUID const& __mingw_uuidof<IEnumSetupInstances>()
>>> referenced by D:\a\1\s\src\windows_com.hpp:898
>>> D:\a\1\s\zig-cache\o\a5030d467932f0ce2f6511feb7d6af12\windows_sdk.obj:(__IEnumSetupInstances_IID_getter())
Thank you to Martin Storsjö for suggesting the fix.
2022-07-09 14:04:38 -07:00
Andrew Kelley
e0d5ae75af
these riscv64 behavior tests work for stage1 but not stage2
2022-07-09 12:48:59 -07:00
Veikka Tuominen
3f11d1d56d
Merge pull request #12050 from topolarity/anon-struct-init
...
stage2: Support initializing anonymous struct type
2022-07-09 18:30:07 +03:00
r00ster91
13d58258a8
std.log: deduplicate switch
2022-07-09 15:19:03 +03:00
Veikka Tuominen
5b36b0ed0c
Sema: use tupleFieldIndex
2022-07-09 14:41:47 +03:00
Yusuke Tanaka
f1da93af3c
Remove outdated TODO comment ( #12053 )
2022-07-09 13:05:41 +02:00
Andrew Kelley
a1c56ffd5a
disable regressed translate-c test case on freebsd
...
see #12055
2022-07-08 23:17:41 -07:00
Andrew Kelley
f976758855
disable failing riscv64 tests from LLVM 14 upgrade
...
See #12054
2022-07-08 23:11:03 -07:00
Andrew Kelley
3e864c86da
CI: azure: update build.zig for LLVM 14
2022-07-08 23:02:38 -07:00
Andrew Kelley
aade8856ee
CI: update scripts to stage1 LLVM 14 tarballs
...
The previous tarballs were stage3 which is not quite ready for primetime
yet.
2022-07-08 21:28:06 -07:00
Cody Tapscott
c830606bbe
stage2: Support @fieldParentPtr for tuples and anon structs
2022-07-08 19:52:23 -07:00
Cody Tapscott
51a8f52e6c
stage2: Support @offsetOf for tuples and anon structs
2022-07-08 19:51:35 -07:00
Cody Tapscott
2fff25fd22
stage2: Support initializing anonymous struct type
...
This commit adds support for initializing `.anon_struct` types. There
is also some follow-up work to do for both tuples and structs regarding
comptime fields, so this also adds some tests to keep track of that
work.
2022-07-08 19:50:28 -07:00
Frank Denis
6f0807f50f
crypto.sign.ed25519: add support for blind key signatures ( #11868 )
...
Key blinding allows public keys to be augmented with a secret
scalar, making multiple signatures from the same signer unlinkable.
https://datatracker.ietf.org/doc/draft-dew-cfrg-signature-key-blinding/
This is required by privacy-preserving applications such as Tor
onion services and the PrivacyPass protocol.
2022-07-08 13:21:37 +02:00
Cody Tapscott
33a39c4b2b
stage2: Fix panic when printing AIR for tuple/anon struct types
2022-07-08 10:19:17 +03:00
Andrew Kelley
bdf3fa12fa
CI: update scripts to new LLVM 14 tarballs
2022-07-07 20:47:58 -07:00
Andrew Kelley
8e492f7d47
compiler_rt: enable __clear_cache for stage2
2022-07-07 20:47:43 -07:00