xackus
92e45ee3a1
std.mem: make sliceAsBytes, etc. respect volatile
2020-11-14 13:59:29 +01:00
xackus
c814fdbfaf
std.mem: improve doc comments
2020-11-14 13:59:29 +01:00
Andrew Kelley
bf03ae7acc
std.fs.path.dirname: return null when input path is root
...
This intentionally diverges from the unix dirname command, as well as
Python and Node.js standard libraries, which all have this edge case
return the input path, unmodified. This is a footgun, and nobody should
have ever done it this way.
Even the man page contradicts the behavior. It says:
"strip last component from file name". Now consider, if you
remove the last item from an array of length 1, then you
have now an array of length 0. After you strip the last component, there
should be no components remaining. Clearly, returning the input parameter
unmodified in this case does not match the documented behavior. This is
my justification for taking a stand on this API design.
closes #6746
closes #6727
closes #6584
closes #6592
closes #6602
2020-11-13 17:36:49 -07: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
Sébastien Marie
ab4b34f75f
openbsd: skip tests using Dir.realpath
2020-11-13 12:30:14 -05: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
joachimschmidt557
b17859b568
stage2 AArch64: add Linux Hello World test
2020-11-11 23:29:18 +01:00
Hubert Jasudowicz
bf73db71f5
std: Fix code model argument
2020-11-11 21:28:10 +02:00
Veikka Tuominen
93844a5ef9
Merge pull request #7061 from Vexu/std
...
std: fix HashMap.putAssumeCapacity
2020-11-11 18:50:34 +02:00
Jakub Konka
5b92d0ea45
stage2 aarch64: add macOS incremental test
2020-11-11 15:36:47 +01: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
Jonas Carpay
c9dc30daf7
Fix backticked code in langref
2020-11-11 15:34:01 +02:00
Vexu
ae6f3291c0
std: fix HashMap.clearRetainingCapacity
2020-11-11 14:05:43 +02:00
Vexu
f70160f89c
std: fix HashMap.putAssumeCapacity
2020-11-11 13:57:08 +02: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
8b9195282e
Merge pull request #7044 from semarie/openbsd-simples
...
Simple sets of commits for OpenBSD support
2020-11-10 18:06:30 -05: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
Andrew Kelley
3110b21c4b
std.Target: bump default version max for macos
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
Sébastien Marie
678bd4fc89
"ResetEvent" test seems to have a too short timeout: the test is failing randomly on OpenBSD
...
raise the timeout to 100ms to be sure that if it fails (timeout is returned) it is due to a real problem.
the test shouldn't be longer: it will wait more time only on failure.
2020-11-10 05:29:53 +00:00
Sébastien Marie
9d306e5c77
openbsd: mutex or cond destroy function could return EINVAL
2020-11-10 05:26:35 +00:00
Sébastien Marie
8784c7b581
openbsd: proper implementation for Thread.cpuCount()
2020-11-10 05:25:59 +00:00
Sébastien Marie
20b19d0092
openbsd: add time definitions for gettimeofday()
2020-11-10 05:24:56 +00:00
Sébastien Marie
e4bc595bc6
openbsd: add sockets constants
2020-11-10 05:24:03 +00:00
Sébastien Marie
17276df488
openbsd: add dlfcn.h definitions for dlopen()
2020-11-10 05:23:13 +00: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
daurnimator
73f3f01670
Fix json parser close tracking ( #6865 )
...
* std: fix json parsing with unmatched closing tokens
* std: fix swapped json parsing errors
2020-11-09 18:29:02 -05:00
xackus
15dbab9a0c
std: json: fix misleading endianness conversion
2020-11-09 18:27:07 -05:00
LemonBoy
e00356d6b1
stage1: Print correct error message for vector @intCast
2020-11-09 18:24:48 -05:00
Frank Denis
427a212e38
Don't prevent compilation on platforms where debug info is unsupported
...
We don't support debug information on platforms that are not tier-1,
but it shouldn't be a hard error that completely prevents compilation.
2020-11-09 18:22:50 -05:00
Alexandros Naskos
fc67e5f843
Windows TLS startup symbols are already provided by libcrt when linking against libc
2020-11-09 17:46:46 -05:00