Vexu
da84ef2a9c
make help in commands more consistent
...
Closes #7101
Co-authored-by: pfg <pfg@pfg.pw>
2020-11-18 13:58:27 +02:00
frmdstryr
a39d3155b4
Change error when runtime value passed to comptime arg
2020-11-18 13:33:45 +02:00
LemonBoy
129ccad434
stage1: Reject undefined values when taking union ptr
...
The code rightfully assumes the union_val object to be fully initialized.
Closes #7019
2020-11-18 13:21:36 +02:00
Veikka Tuominen
6d5b76a75d
Merge pull request #7005 from jshholland/deprecate-span
...
Remove ArrayList.span
2020-11-18 13:14:48 +02:00
Timon Kruiper
66d6930b5c
Allow Zig to be built with clang 11 and -Werror
...
This was brought to the horizon when using zig-bootstrap to cross compile
Zig for windows-gnu.
2020-11-18 13:09:44 +02:00
LemonBoy
bef140c0a2
stage1: Add architecture-specific clobbers to asm()
...
We're basically following Clang's lead, add the necessary clobbers to
minimize the risk of generating wrong code.
2020-11-18 13:08:04 +02:00
Jakub Konka
39336fd2e9
stage2 aarch64: assert register is 64bits in PCrel
...
Thanks @joachimschmidt557 for pointing out this fix!
2020-11-18 10:12:39 +01:00
Jakub Konka
5ff8dd179e
stage2 aarch64: add PC relative address instructions
2020-11-18 08:46:52 +01:00
LemonBoy
fa27420b72
stage1: Fix asyncCall with non-abi-aligned arguments
...
Make the code used to calculate the variable slot index into the frame
match what's done during the structure layout calculation.
Prevents a few nasty LLVM errors when such types are passed around.
2020-11-17 15:55:12 -08:00
Andrew Kelley
af4727814b
cli: make -h, --help consistent in usage text and parsing
...
also trivial fixes in the general usage text
2020-11-17 16:53:45 -07:00
Alexandros Naskos
21a77f7ac3
Merge pull request #7032 from GuoxinYin/master
...
Add -h alias for --help
2020-11-17 15:52:39 +02:00
tgschultz
48d60834fd
Move leb128 and remove trivial *mem functions as discussed in #5588 ( #6876 )
...
* Move leb128 out of debug and remove trivial *mem functions as discussed in #5588
* Turns out one of the *Mem functions was used by MachO. Replaced with trivial use of FixedBufferStream.
2020-11-16 18:51:54 -05:00
Andrew Kelley
d9c36cb250
Merge pull request #6878 from frmdstryr/multiline-string-comments
...
Support comments in multiline string literals
2020-11-16 14:05:15 -08:00
Alex Cameron
a2582df5b2
Prevent double file close in MachO linking
2020-11-16 13:59:27 -08:00
Frank Denis
0c520cd32d
Enable loop interleaving when unrolling is enabled
...
This mimics clang's default behavior.
2020-11-16 13:40:52 -08:00
Jakub Konka
8f47e8feb6
stage2 aarch64: add NOP instruction
2020-11-16 13:37:38 -08:00
Alexandros Naskos
6e2e747b0b
Merge pull request #7112 from LemonBoy/fix-7104
...
stage1: Fix generation of pass-by-value args in async fns
2020-11-16 09:12:42 +02:00
LemonBoy
7ebbc717c0
stage1: Fix generation of pass-by-value args in async fns
...
The mismatch between the argument slot type in the frame structure and
the one used in the store operation made the generated code write
garbage over the nearby fields.
Fixes #7104
2020-11-14 15:30:06 +01:00
LemonBoy
211feea914
stage1: Disambiguate Wasm imports with same name
...
Closes #7088
2020-11-13 16:32:42 -05:00
LemonBoy
c4fd3fc270
stage1: Resolve ErrorUnion children types
...
Since the code is accessing the abi_size field compute the full type
size for both err_set_type and payload_type, not only for the latter.
2020-11-13 14:28:40 -07:00
LemonBoy
b52a28a802
stage1: Ask LLVM to produce compact code in ReleaseSize mode
...
Let's follow what Clang does for -Oz and apply the `minsize` and
`optsize` attributes by default.
Closes #7048
Supersedes #7077
2020-11-13 12:25:13 -05:00
Jakub Konka
51717314e4
Merge pull request #6900 from joachimschmidt557/stage2-aarch64
...
Add stage2 AArch64 backend
2020-11-12 20:41:15 +01:00
joachimschmidt557
c6d46a9b82
stage2 ARM & AArch64: ensure correct function alignment
2020-11-12 16:24:51 +01:00
Andrew Kelley
2d42532fec
main: clean up the error message for missing positional args
2020-11-11 19:35:07 -07:00
Vexu
08270d72b4
ensure TypeInfo payload is not undefined
2020-11-11 16:04:46 +02:00
g-w1
61c51f0ac9
Add error for missing positional arguments in zig build-*
...
Closes #6938
2020-11-11 15:54:08 +02:00
LemonBoy
5872ae5111
stage1: Fix crash in comptime struct generation
...
Using the gen_index rather than the src_index is needed to handle
structures containing zero-sized or comptime only types.
Closes #7027
2020-11-11 15:35:19 +02:00
Jakub Konka
a6bc19ea2a
stage2 aarch64: add genCall for aarch64 MachO
2020-11-11 14:34:53 +01:00
Jakub Konka
993eb22a77
stage2 aarch64: add .memory prong in genSetReg
2020-11-11 14:34:53 +01:00
Jakub Konka
f512676d0b
stage2 aarch64: add str instruction
2020-11-11 14:34:53 +01:00
Jakub Konka
f1960302d1
stage2 aarch64: add ldr instruction + smoke tests
2020-11-11 14:34:53 +01:00
joachimschmidt557
ca0016a225
stage2 ARM: start implementing genCall for ELF + genSetReg immediates
2020-11-11 14:34:53 +01:00
joachimschmidt557
aa9df72f71
stage2 AArch64: MoveWideImmediate instructions + test coverage
2020-11-11 14:34:53 +01:00
joachimschmidt557
4c8f69241a
stage2 aarch64: add more instructions
2020-11-11 14:34:53 +01:00
joachimschmidt557
3c75d723ac
stage2 aarch64: add codegen/aarch64.zig
2020-11-11 14:34:53 +01:00
Jakub Konka
4ef6864a15
Add move wide with zero (movz) instruction
2020-11-11 14:34:53 +01:00
Jakub Konka
d601b0f4eb
Add basic genSetReg for aarch64
2020-11-11 14:34:53 +01:00
Jakub Konka
68bb1e91aa
Add testcase for serializing svc #0x80
2020-11-11 14:34:53 +01:00
Jakub Konka
d542e88706
Implement genAsm on aarch64
...
Add remaining PCS info: param and return registers in procedure calls.
2020-11-11 14:34:53 +01:00
joachimschmidt557
5ad501c00b
stage2 aarch64: add codegen/aarch64.zig
2020-11-11 14:34:53 +01:00
LemonBoy
f0b1b74d21
stage1: Avoid resolving type entry in [0]T
...
The logic was already there but this rule was only applied in some
places, apply it in the remaining code paths.
Closes #7058
2020-11-11 13:53:24 +02:00
Andrew Kelley
6904cd828e
add missing -m<os>-version-min CLI args to clang
...
This fixes some code generation issues when targeting macOS and
compiling C/C++ code.
2020-11-10 15:24:10 -07:00
LemonBoy
4d4ab1e69a
stage1: Fix comparison of unions containing zero-sized types
...
The code tried to be too smart and skipped the equality (returning true)
if the payload type was zero-sized.
This optimization is completely wrong when the union payload is a
metatype!
Fixes #7047
2020-11-10 17:21:49 -05:00
Andrew Kelley
06a3a69e6f
main: updateModule returns an error when there are any compile errors
...
closes #6976
2020-11-09 20:51:09 -07:00
LemonBoy
e00356d6b1
stage1: Print correct error message for vector @intCast
2020-11-09 18:24:48 -05:00
Andrew Kelley
e78e0f57be
macos: avoid --export-dynamic when using system linker
2020-11-08 23:04:38 -08:00
Andrew Kelley
4d67c3d887
macOS: depend on bundled headers even for native
...
This is an alternate fix for #6773 . Reverts
872bc787b56f71e53c80f4681523bc8356915b71.
2020-11-08 18:51:12 -07:00
Guoxin Yin
7b8cb002cb
fix issue 6798
2020-11-09 02:58:45 +08:00
Guoxin Yin
b6c85df55a
fix issue 6798
2020-11-09 02:48:17 +08:00
joachimschmidt557
03ae77b8b0
stage2 ARM: miscellaneous improvements
2020-11-07 17:27:23 +01:00