Commit Graph

10961 Commits

Author SHA1 Message Date
Andrew Kelley 8484df5bd2 zig cc: add -Wno-overriding-t-option to clang on darwin
This avoids a warning that sometimes occurs when providing both a
-target argument that contains a version as well as the
-mmacosx-version-min argument. Zig provides the correct value in both
places, so it doesn't matter which one gets overridden.
2023-01-22 12:27:18 -07:00
joachimschmidt557 c0284e242f stage2 ARM: add basic debug info for locals
Also disables one behavior test which was failing
2023-01-22 12:00:04 +01:00
Andrew Kelley a51c76541d Merge pull request #14403 from Vexu/fixes
Misc fixes
2023-01-22 00:36:50 -05:00
Jakub Konka 562d52e23d Merge pull request #14397 from ziglang/macho-unwind-info
zld: handle parsing and synthesising unwind info in the MachO linker
2023-01-22 00:44:44 +01:00
Veikka Tuominen aa626deadd llvm: implement explicit Win64 and SysV calling conventions 2023-01-22 01:04:20 +02:00
Veikka Tuominen a28fbf3132 Sema: fix error message for bad pointer arithmetic
Closes #14388
2023-01-22 01:04:20 +02:00
Veikka Tuominen 1f475de852 Sema: fix unwrapping null when reporting error on member access
Closes #14399
2023-01-22 01:04:20 +02:00
Veikka Tuominen 5259d11e3b Sema: resolve fields before checking tuple len
Closes #14400
2023-01-22 00:12:37 +02:00
Veikka Tuominen 5f5ab49168 Value: implement compareAllWithZero for bytes and str_lit
Closes #10692
2023-01-22 00:12:37 +02:00
Veikka Tuominen a492a607d5 type: correct condition for eliding pointer alignment canonicalization
Closes #14373
2023-01-22 00:12:37 +02:00
Veikka Tuominen d284c00fda Sema: handle lazy values in more places
* resolve lazy values in anon structs being passed to anytype params
* use `resolveMaybeUndefValIntable` where appropriate

Closes #14356
2023-01-22 00:12:36 +02:00
Stephen Gregoratto 7f635ae7bd FreeBSD: add mcontext_t for aarch64
What isn't disabled for test-std mostly passes, except for the copysign
and signbit tests for f16. Seemingly related to #14366.
2023-01-21 23:20:50 +02:00
Jakub Konka 6fd1d7b372 zld: fix 32bit build 2023-01-21 17:17:34 +01:00
Jakub Konka 983e373409 macho: fix sorting symbols by seniority 2023-01-21 16:53:46 +01:00
Jakub Konka 02db9933a4 macho: properly relocate target symbol address in __eh_frame 2023-01-21 14:11:56 +01:00
Jakub Konka 3dff040ca5 macho: synthesise unwind records in absence of compact unwind section
Unlike Apple ld, we will not do any DWARF CFI parsing and simply
output DWARF type unwind records.
2023-01-21 13:37:48 +01:00
Jakub Konka 835a60a34f zld: parse, synthesise and emit unwind records 2023-01-20 18:43:16 +01:00
Jakub Konka 9f0cb763a4 macho: disable some log messages 2023-01-20 13:10:20 +01:00
Jakub Konka 9d2711a3d9 macho: use ArrayHashMap for tracking of dyld runtime metadata 2023-01-20 12:10:16 +01:00
Jakub Konka e17c551a2e macho: revert ordering tweak of lazy bind pointers and add logging 2023-01-20 11:00:08 +01:00
Jakub Konka dcdbfba770 macho: require an exclusive lock to the Cache.Manifest 2023-01-20 10:59:48 +01:00
Veikka Tuominen fe6dcdba14 Merge pull request #14357 from kcbanner/llvm_byval_struct
llvm: implement Stdcall calling convention
2023-01-20 04:38:49 +02:00
Jakub Konka 989b0e620b Merge pull request #14369 from ziglang/macho-dyld-ops
macho+zld: add improved dyld opcodes emitters
2023-01-19 19:49:51 +01:00
Veikka Tuominen 2b7678bc42 llvm: implement Stdcall return types 2023-01-19 16:13:52 +02:00
Jakub Konka bcd16b2708 macho: fix ordering issue with lazy bind pointers 2023-01-19 14:06:47 +01:00
Jakub Konka b2febd1ce7 macho: fix 32bit build 2023-01-19 09:53:18 +01:00
kcbanner 5949851074 llvm: pass non-scalars as byref in .Stdcall
- add c_abi tests for .Stdcall
- enable (x86|x86_64)-windows-gnu in the c_abi tests
2023-01-19 00:37:56 -05:00
Jakub Konka 61e38d0c34 macho+zld: add improved dyld opcodes emitters 2023-01-19 00:05:45 +01:00
Loris Cro 35f5d43768 autodoc: add support for top-level doc comments 2023-01-18 19:45:32 +01:00
Michael Dusan c9f7b32fbd netbsd: add mcontext_t for aarch64
- test `lib/std/std.zig` passes
- stack traces work
2023-01-18 02:50:11 -05:00
Veikka Tuominen fc066992d9 Sema: do not create slices with undefined pointers
The undef pointer ended up being zero on wasm32.
2023-01-17 20:28:43 +02:00
Veikka Tuominen 3b2c421102 Sema: fix bad boolean logic for cast to null panic
Closes #14349
2023-01-17 20:28:43 +02:00
Veikka Tuominen e04547642a Sema: promote smaller float types passed to variadic functions
Closes #6854
2023-01-17 20:28:43 +02:00
Veikka Tuominen 14f03fbd16 AstGen: reset source cursor before generating pointer attributes
These attributes can appear in any order but AstGen expects the source
cursor to be incremented in a monotonically increasing order.

Closes #14332
2023-01-17 20:28:43 +02:00
Veikka Tuominen 24646b8b5d windows x86_64 C ABI: pass byref structs as byref_mut 2023-01-17 20:28:43 +02:00
Veikka Tuominen 8b35f09f4a Sema: resolve lazy values in switch prong items
Closes #14330
2023-01-17 20:28:43 +02:00
Veikka Tuominen 6b037bad59 Sema: ignore dependency loops in typeinfo decls
This matches stage1 behavior.

Closes #14322
2023-01-17 20:28:43 +02:00
Veikka Tuominen 6e067dc050 llvm: do not offset packed struct field pointers if they have a host size
Closes #14261
2023-01-17 20:28:42 +02:00
Andrew Kelley d56a65a8c4 std.http.Client: default to lazy root cert scanning
After this change, the system will be inspected for root certificates
only upon the first https request that actually occurs. This makes the
compiler no longer do SSL certificate scanning when running `zig build`
if no network requests are made.
2023-01-17 01:44:56 -05:00
Andrew Kelley e646becd04 Merge pull request #14336 from Vexu/field-reorder
Sema: automatically optimize order of struct fields
2023-01-16 21:19:48 -05:00
fn ⌃ ⌥ e45b471ad3 Find system-installed root SSL certificates on macOS (#14325) 2023-01-16 22:34:04 +00:00
Veikka Tuominen 342bae02d8 Sema: automatically optimize order of struct fields
This is a simple starting version of the optimization described in #168
where the fields are just sorted by order of descending alignment.
2023-01-16 19:46:41 +02:00
Loris Cro b42bd759a7 autodoc: missing fmt on Autodoc.zig 2023-01-16 18:04:31 +01:00
Krzysztof Wolicki ae69dfe6e7 autodoc: Better handling of variable decls (#14301) 2023-01-16 17:28:07 +01:00
Techatrix 32544ed56c swap align and callconv in function typeName 2023-01-16 14:04:03 +02:00
Veikka Tuominen bb15e4057c Merge pull request #14271 from Vexu/c-abi
float related C ABI fixes
2023-01-14 21:42:29 +02:00
Luuk de Gram 18191b80b6 Merge pull request #14302 from Luukdegram/wasm-ctor
wasm-linker: implement linking with WASI-libc
2023-01-14 17:58:09 +01:00
Veikka Tuominen 0013042cbd llvm: correctly handle C ABI structs with f32/f64 alignment differences
Closes #13830
2023-01-14 16:26:50 +02:00
Veikka Tuominen 5572c67e73 add C ABI tests for exotic float types 2023-01-14 16:26:50 +02:00
Motiejus Jakštys 6b3f59c3a7 zig run/cc: recognize "-x language"
This commit adds support for "-x language" for a couple of hand-picked
supported languages. There is no reason the list of supported languages
to not grow (e.g. add "c-header"), but I'd like to keep it small at the
start.

Alternative 1
-------------

I first tried to add a new type "Language", and then add that to the
`CSourceFile`. But oh boy what a change it turns out to be. So I am
keeping myself tied to FileExt and see what you folks think.

Alternative 2
-------------

I tried adding `Language: ?[]const u8` to `CSourceFile`. However, the
language/ext, whatever we want to call it, still needs to be interpreted
in the main loop: one kind of handling for source files, other kind of
handling for everything else.

Test case
---------

*standalone.c*

    #include <iostream>

    int main() {
        std::cout << "elho\n";
    }

Compile and run:

    $ ./zig run -x c++ -lc++ standalone.c
    elho
    $ ./zig c++ -x c++ standalone.c -o standalone && ./standalone
    elho

Fixes #10915
2023-01-13 21:38:11 -05:00