11548 Commits

Author SHA1 Message Date
Jakub Konka
5e19250a12
Merge pull request #15185 from ziglang/macho-tls
macho: add TLS support
2023-04-13 22:54:55 +02:00
Luuk de Gram
25e3851fe0
Merge pull request #15257 from Luukdegram/wasm-tagname
wasm: Implement `@tagName` instruction
2023-04-13 19:32:22 +02:00
Krzysztof Wolicki
8bbf62c3b9 autodoc: Handling of explicit values for enum fields
Fixes to frontend handling of structs
2023-04-13 17:42:29 +02:00
Krzysztof Wolicki
97b3b36c65 autodoc: Handling of default values for struct fields 2023-04-13 17:42:29 +02:00
Loris Cro
5c9906c231 autodoc: make DeclStatus references long-lived 2023-04-13 17:38:24 +02:00
Jakub Konka
3f35d6984f x86_64: make TLV a separate MCValue 2023-04-13 16:35:45 +02:00
Jakub Konka
887da399eb x86_64: fix load() and store() to accommodate TLV 2023-04-13 11:47:51 +02:00
Jakub Konka
fd52d4537a x86_64: emit pointer to TLV for macho 2023-04-13 11:47:51 +02:00
Jakub Konka
1f6165f621 macho: reference TLV thunks via GOT table 2023-04-13 11:47:51 +02:00
Jakub Konka
094ff60252 macho: emit TLV pointers and variables 2023-04-13 11:47:51 +02:00
Jakub Konka
09b6bd86de macho: cleanup dirtying and writing GOT atoms 2023-04-13 11:47:51 +02:00
Jakub Konka
57f9304275 macho: improve reporting of missing symbols
Fix a typo in TLV bootstrap symbol: __tlv_bootstrap.
2023-04-13 11:47:51 +02:00
Jakub Konka
ef645ab175 macho: refactor common logic between synthetic tables 2023-04-13 11:47:51 +02:00
Jakub Konka
38ecaf3ab6 macho: add machinery for emitting TLV refs 2023-04-13 11:47:51 +02:00
Jakub Konka
eba280ce20 macho: refactor relocation type in incremental linker 2023-04-13 11:47:51 +02:00
Jakub Konka
1795b8eb4e macho: emit TLS sections 2023-04-13 11:47:51 +02:00
Jakub Konka
cf9ba2965e x86_64: remove loadMemPtrIntoRegister() now redundant 2023-04-13 11:47:51 +02:00
Jakub Konka
e07120d704 x86_64: simplify genInlineMemset() when setting value in memory 2023-04-13 11:47:51 +02:00
Jakub Konka
4e3573955f x86_64: simplify genInlineMemcpy() when copying from memory 2023-04-13 11:47:51 +02:00
Jakub Konka
aab0039b42 x86_64: simplify genSetStack() when storing value from memory 2023-04-13 11:47:51 +02:00
Jakub Konka
0abaf5f88a x86_64: simplify genSetStackArg() when storing value from memory 2023-04-13 11:47:51 +02:00
Jakub Konka
059ed062bc x86_64: simplify isNull() when loading optional from memory 2023-04-13 11:47:51 +02:00
Jakub Konka
e05a51cb62 x86_64: simplify airArrayElemVal() when pulling array from memory 2023-04-13 11:47:51 +02:00
Jakub Konka
c8c5951e23 x86_64: simplify genBinOp() and genBinOpMir() when modifying value in memory 2023-04-13 11:47:51 +02:00
Jakub Konka
38d46a6764 x86_64: simplify genUnOpMir() when modifying value in memory 2023-04-13 11:47:51 +02:00
Jakub Konka
dbdf8086bd x86_64: simplify store() logic when ptr is in memory 2023-04-13 11:47:51 +02:00
Jakub Konka
397dd77697 x86_64: simplify store() logic when value is in memory 2023-04-13 11:47:51 +02:00
Jakub Konka
ee6b4fad47 x86_64: remove loadMemPtrIntoRegister in genSetReg
Add two emit helpers for linker reloc based `lea` and `mov`
instructions: `asmMovLinker` and `asmLeaLinker`.
2023-04-13 11:47:51 +02:00
Jakub Konka
382de7bf1d codegen: use non-debug Type/Value formatting 2023-04-13 11:47:51 +02:00
Jakub Konka
5154ece8b9 macho: fix incorrect DWARF subprogram generation 2023-04-13 11:47:50 +02:00
Jacob Young
e72c41a32a x86_64: fix clz miscompile 2023-04-13 04:17:54 -04:00
Jacob Young
caa3d6a4f4 x86_64: fix constant pointers to zero-bit types
These non-dereferencable pointers still need to have the correct
alignment and non-null-ness.
2023-04-13 04:17:47 -04:00
Jacob Young
3b22ce8264 x86_64: fix atomic loop implementation 2023-04-13 04:17:47 -04:00
Jacob Young
0165187cd0 x86_64: fix some of the mass confusion about the meaning of MCValue 2023-04-13 04:17:47 -04:00
Andrew Kelley
e2fe1907ec add c_char type
closes #875
2023-04-13 02:47:16 -04:00
Luuk de Gram
5c451b6e63
wasm: make tagName null-terminated 2023-04-12 22:23:36 +02:00
Luuk de Gram
370401cf60
wasm: generate unnamed constant for tag 2023-04-12 22:23:36 +02:00
Luuk de Gram
3c27df6b13
wasm: generate function to get tag name
When we lower the instruction for `@tagName` we generate a new
function if it doesn't exist yet for that decl. This function creates
an if-else chain to determine which value was provided. Each tag
generates a constant that contains its name as the value. For each
tag we generate a case where the pointer of the string is stored in
the result slice. The length of the tagname is comptime-known, therefore
will be stored in the slice directly without having it being part of
the tagname symbol. In the future this can use a jump table instead
of an if-else chain, similar to the `switch` instruction.
2023-04-12 22:23:32 +02:00
mlugg
ccf670c2b0 Zir: implement explicit block_comptime instruction
Resolves: #7056
2023-04-12 12:06:19 -04:00
Loris Cro
602029bb2f
Autodoc usingnamespace (#15216)
* autodoc: init support for usingnamespace decls

* autodoc: don't build autodoc when building zig2.c

* autodoc: usingnamespace decls support in frontend (#15203)

* autodoc: init support for usingnamespace decls

* autodoc: usingnamespace decls support in frontend

---------

Co-authored-by: Krzysztof Wolicki <46651553+der-teufel-programming@users.noreply.github.com>
2023-04-12 01:14:02 +00:00
Andrew Kelley
c96cb98ad1 CLI: remove --enable-cache option
This use case is now handled instead by the --listen option.

closes #15025
closes #15072
2023-04-11 08:41:24 -07:00
Jacob Young
23d7921758 Sema: avoid emitting loops that can't loop
If a `loop` ends with a `noreturn` instruction, then it cannot loop and
will be emitted as a `block` instead.
2023-04-10 20:57:49 -04:00
Piotr Sikora
cb54e9a3c2 glibc: allow linking against external libcrypt.
Support for the built-in libcrypt was removed in commit 6b7ddfba,
but the -lcrypt flag remained ignored, preventing linking against
external libcrypt.

Fixes #5990.

Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
2023-04-10 20:04:29 -04:00
Andrew Kelley
a2793f8ab8
Merge pull request #14853 from schmee/vector-peer-type-resolution
Vector type resolution/coercion fixes
2023-04-10 12:21:55 -04:00
GethDW
2c639d6570 std.MultiArrayList: add support for tagged unions. 2023-04-10 12:15:05 -04:00
Andrew Kelley
88dfb13818
Merge pull request #14882 from xxxbxxx/master
objcopy: add some support for --strip-debug and --strip-all
2023-04-10 12:06:13 -04:00
Andrew Kelley
aeae71f462
Merge pull request #15068 from Snektron/spirv-test-runner-support
spirv: test runner support
2023-04-10 10:44:35 -04:00
Andrew Kelley
2ee328995a
Merge pull request #15123 from truemedian/http-server
std.http: add http server
2023-04-09 10:44:52 -04:00
Robin Voetter
d1484bf4b9
spirv: emit nonsemantic info with zig errors
In order to be able to report nice errors in the test runner, and in order
to check SkipZigTest errors, we need to pass the error names to the consumer.
This kind of information can be passed via nonsemantic instructions - using
OpSourceExtension here.

All errors are concatenated into a single string, starting with 'zig_errors:'
for identification, separated by a colon (:). To ensure that we can represent
all error codes, even those which contain a colon, the error names are URI-
escaped. URI-escaping, rather than base64, allows us to see the error names
when viewing disassembled SPIR-V code.
2023-04-09 01:51:55 +02:00
Robin Voetter
979b410258
spirv: Do not generate the Alignment attribute on pointers for now
It seems that some implementations may have problems with these right now,
like Intel and Rusticl. In theory, these attributes should be superficial
on the pointer type, as alignment guarantees are also added via the
alignment option of the OpLoad and OpStore instructions. Therefore, get rid
of them for now.
2023-04-09 01:51:55 +02:00