Evan Haas
d321a4b765
translate-c: Translate FnDecl's that appear within functions
2021-05-23 15:42:36 +03:00
joachimschmidt557
e8236551ab
stage2: Move BlockData out of ir.Inst.Block
2021-05-22 21:15:25 -04:00
Andrew Kelley
1c636e2564
Merge pull request #8844 from ifreund/inline
...
Support inline keyword as well as callconv(.Inline)
2021-05-22 20:56:30 -04:00
jacob gw
9baf891772
stage2: astgen error for return or try in defer block
2021-05-22 20:54:14 -04:00
Sébastien Marie
ceacb7d247
openbsd: complete kqueue(2) constant definitions
2021-05-22 20:52:44 -04:00
Isaac Freund
b2126d3345
stage2: only pass -lm -lc -ldl for android libc
...
The other libc components are not available on android.
2021-05-22 20:52:14 -04:00
Sobeston
742d588b3a
std.os: munmap takes a const pointer
2021-05-22 20:51:53 -04:00
Matthew Borkowski
d7bf4f8070
fix Boyer-Moore-Horspool algorithm in indexOfPos and lastIndexOf when element type is larger than a byte
2021-05-22 20:51:17 -04:00
Jakub Konka
8c87a981f1
cc,wasi: force isysroot to /
2021-05-22 20:50:06 -04:00
Andrew Kelley
b750e074c6
stage2: rework astgen command into zig ast-check
...
This addresses the use case of quickly reporting AstGen compile errors
for a file, for use with an IDE for example.
* Rename from `zig asgen` to `zig ast-check`
* It is now a command always available; not only in debug builds.
* Give it usage text and proper CLI parsing.
* Support reading from stdin when no positional arg is provided.
* `-t` flag makes it print textual ZIR. Without this flag, it only
provides compile errors.
* Support `--color` parameter to override the tty detection
closes #8871
2021-05-22 17:23:16 -07:00
Andrew Kelley
51701fb2da
stage2: omit printing source lines in compile errors
...
when configured to not use tty awareness
2021-05-22 17:17:32 -07:00
Andrew Kelley
63aabbbba7
Merge pull request #8852 from Snektron/spirv
...
SPIR-V: More codegen
2021-05-22 18:20:20 -04:00
Andrew Kelley
7cd9b30e0a
Merge pull request #7664 from marler8997/fixWindowsPaths
...
implement nt path conversion for windows
2021-05-22 17:58:59 -04:00
Andrew Kelley
79dee75b1c
stage2: rename ir.zig to air.zig
...
We've settled on the nomenclature for the artifacts the compiler
pipeline produces:
1. Tokens
2. AST (Abstract Syntax Tree)
3. ZIR (Zig Intermediate Representation)
4. AIR (Analyzed Intermediate Representation)
5. Machine Code
Renaming `ir` identifiers to `air` will come with the inevitable
air-memory-layout branch that I plan to start after the 0.8.0 release.
2021-05-22 14:29:16 -07:00
Jakub Konka
9d311e9960
Merge pull request #8857 from ziglang/cc-wasm-ar
...
wasm: produce static lib by default and rename produced object files to simply .o from .o.wasm
2021-05-22 16:13:47 +02:00
Jakub Konka
2b0d322ea0
zld: permit system static libs
...
This commits permits passing in static archives using the system
lib flag `-la`. With this commit, `zig ld` will now look firstly for
a dynamic library (which always takes precedence), and will fall back
on `liba.a` if the dylib is not found. The static archive is searched
for in the system lib search dirs like the dylibs.
2021-05-22 16:12:45 +02:00
Robin Voetter
cba97e4773
SPIR-V: Make functions which always return a null result return void instead
2021-05-22 16:11:56 +02:00
Robin Voetter
228f71fa0c
SPIR-V: Generate locals at the start of a function
2021-05-22 16:11:56 +02:00
Robin Voetter
6634abfd26
SPIR-V: Debug line info/source info
2021-05-22 16:11:56 +02:00
Robin Voetter
e3be1a1e88
SPIR-V: DeclGen constructor/destructor
2021-05-22 16:11:56 +02:00
Robin Voetter
46184ab85e
SPIR-V: branching
2021-05-22 16:11:56 +02:00
Robin Voetter
5edc5f9730
SPIR-V: Pass source location to genType and genConstant for better error reporting
2021-05-22 16:11:56 +02:00
Robin Voetter
63d0576f1c
SPIR-V: Preliminary alloc/store/load generation
2021-05-22 16:11:56 +02:00
Robin Voetter
6a121d9ccd
SPIR-V: Split out genCmp from genBinOp
2021-05-22 16:11:56 +02:00
Robin Voetter
b8444d2c51
SPIR-V: Preliminary integer constant encoding
2021-05-22 16:11:56 +02:00
Robin Voetter
c190b2ff83
SPIR-V: ResultId and Word aliases to improve code clarity
2021-05-22 16:11:56 +02:00
Robin Voetter
9ddd7f4a60
SPIR-V: Put types in SPIRVModule, some general restructuring
2021-05-22 16:11:56 +02:00
Robin Voetter
bcda3c5b82
SPIR-V: Use Value.toFloat instead of switching on value tag when generating float constants
2021-05-22 16:11:56 +02:00
Matthew Borkowski
f4101c1153
fix accidental quadratic dependence on haystack length in replace and replacementSize ( #8859 )
2021-05-22 10:55:28 +02:00
Jakub Konka
bd325d1bd9
wasm: fix object extension to standard .o from .o.wasm
...
This should offer more compatibility with external tooling when
cross-compiling to wasm with zig.
2021-05-21 22:29:36 +02:00
Jakub Konka
fbd96907c9
wasm: build static archive unless -dynamic specified
...
This matches the behaviour for other targets in that
```
zig build-lib math.zig -target wasm32-freestanding
```
produces now `libmath.a` while
```
zig build-lib math.zig -dynamic -target wasm32-freestanding
```
is required to create a loadable Wasm module.
2021-05-21 20:24:13 +02:00
Jonathan Marler
b0116afd8a
handle relative paths with too many ".."
2021-05-21 01:29:40 -06:00
Jakub Konka
4b69bd61e4
Merge pull request #8837 from ziglang/cc-wasm32-wasi
...
cc,wasi: ship WASI libc and autobuild it when needed
2021-05-21 09:04:16 +02:00
Andrew Kelley
0267abfe9b
Merge pull request #8847 from Luukdegram/wasm-struct-switch
...
stage2: wasm - Structs and switch support
2021-05-20 18:55:49 -04:00
mason1920
884547f177
Const correct GUID parameter of getInfo and setInfo
2021-05-20 18:53:59 -04:00
Andrew Kelley
495e996169
Merge pull request #8776 from notviri/windows-wm-constants
...
fix & add some Win32 window message constants
2021-05-20 18:51:45 -04:00
Matthew Borkowski
510f858143
fix calculation of max_io_bits in PackedIntIo
2021-05-20 18:47:16 -04:00
Andrew Kelley
3845c264a6
stage2: fix compile error rendering for hard tabs
...
render them as 1 space instead. This fixes the column caret.
2021-05-20 15:20:27 -07:00
Jonathan Marler
59de5d0350
add the openDir cwd parent test
2021-05-20 14:00:41 -06:00
Jonathan Marler
a72ad61cd4
have collapseRepeats return slice intead of just len
2021-05-20 14:00:41 -06:00
Jonathan Marler
666584067a
implement nt path conversion for windows
2021-05-20 14:00:40 -06:00
Isaac Freund
563ea60a86
translate-c: use inline keyword instead of callconv(.Inline)
2021-05-20 21:59:46 +02:00
Andrew Kelley
34d0542a53
Merge pull request #8695 from Bxil/socket
...
std.os: WSAStartup is now called upon socket creation when needed
2021-05-20 15:31:22 -04:00
Andrew Kelley
61850f8883
std: Windows: WSASocketW ensures WSAStartup
...
When WSASocketW gets WSANOTINITIALISED, now it will lock a mutex to
safely call WSAStartup and then try again one time.
This implementation:
* Does not use recursion
* Contains a detailed doc comment explaining why things are how they are
* Is careful about which errors are surfaced in the respective error
sets. `std.os.socket` intentionally does not have "not initialised"
as one of the possible errors.
2021-05-20 12:28:30 -07:00
Bxil
85c2ffc9ba
std.os: WSAStartup is now called upon socket creation when needed
2021-05-20 11:22:55 -07:00
Andrew Kelley
df56bf94a2
Merge pull request #8789 from Luukdegram/wasm-enum
...
stage2: wasm backend - Enums
2021-05-20 14:03:54 -04:00
Luuk de Gram
0ac56e7f3a
Add test cases for switches
2021-05-20 19:59:37 +02:00
Isaac Freund
5b850d5c92
Run zig fmt on src/ and lib/std/
...
This replaces callconv(.Inline) with the more idiomatic inline keyword.
2021-05-20 17:14:18 +02:00
Isaac Freund
4a582734fd
zig fmt: replace callconv(.Inline) with the inline keyword
2021-05-20 17:13:47 +02:00
Jakub Konka
b63c92f0b9
cc,wasi: do not add stack protector
2021-05-20 16:54:00 +02:00