Andrew Kelley
29c9d5896c
Merge branch 'Stage2 begin implementing container types'
2021-01-11 16:25:21 -07:00
Andrew Kelley
5cc2e500e6
Merge branch 'SpexGuy-fix-comptime-cityhash'
...
I commented out the comptime test though since it was causing OOM on the
CI server.
closes #7331
2021-01-11 13:58:31 -07:00
Andrew Kelley
0c8e2c987d
std CityHash: disable memory-expensive tests for now
2021-01-11 13:58:06 -07:00
Martin Wickham
21213127ec
Modify cityhash to work at comptime
2021-01-11 13:52:52 -07:00
Andrew Kelley
73b17474d7
Merge pull request #7134 from alexnask/fix_std_fs_watch
...
The std.fs.Watch rewrite PR
2021-01-11 12:45:36 -08:00
Travis
cc2981edfc
update path.join to recognize any separators that isSep does
2021-01-11 11:15:34 -08:00
Andrew Kelley
1295525a7a
Merge branch 'AdamGoertz-master'
...
closes #5080
closes #6887
2021-01-10 19:04:22 -07:00
Andrew Kelley
169810b20f
zig fmt
2021-01-10 19:04:10 -07:00
Adam Goertz
0f32de77c9
impl lossyCast #5080
2021-01-10 19:02:41 -07:00
Timon Kruiper
e1d8073d2f
stage2: add support for loops in LLVM backend
...
A simple `while(true) {}` loop generates the following LLVMIR:
```
define i32 @main() {
Entry:
br label %Loop
Loop: ; preds = %Loop, %Entry
br label %Loop
}
```
Also implement TZIR printing for loops and add a corresponding test.
2021-01-10 17:47:34 -08:00
Vincent Rischmann
2117489e05
debug: don't fail printLineInfo if the source file is not readable
...
Without this dumping a stacktrace fails with this:
Unable to dump stack trace: AccessDenied
2021-01-10 17:46:15 -08:00
joachimschmidt557
a7da90071e
stage2: fix bug in genArg
...
When an argument is unused in the function body, still increment
arg_index so we still select the correct arguments in the args slice.
2021-01-10 00:41:02 -08:00
Andrew Kelley
29928af600
Merge pull request #7729 from jayschwa/remove-deprecated-stream
...
Remove deprecated stream aliases
2021-01-09 13:04:08 -08:00
Jay Petacat
a0ad2dee6a
builtin: Add zig_version
...
This will enable code to perform version checks and make it easier to
support multiple versions of Zig.
Within the SemVer implementation, an intermediate value needed to be
coerced to a slice to workaround a comptime bug.
Closes #6466
2021-01-09 12:50:39 -08:00
Andrew Kelley
5c49a137d5
Merge pull request #7725 from FireFox317/even-more-llvm
...
stage2: initial implementation of control flow in LLVM backend + TZIR printing
2021-01-09 12:32:10 -08:00
xackus
e4b8148e9c
Fix system library path detection on linux
...
Uses the NativeTargetInfo results instead of std.Target.current.
2021-01-08 20:07:59 -07:00
LemonBoy
eb696e453f
stage2: Implicitly enable --eh_frame_hdr when compiling c/c++ files
...
Matches what Clang/GCC driver do.
Closes #7711
2021-01-08 19:01:05 -08:00
Sobeston
95e66a915b
added mem.containsAtLeast
2021-01-08 18:12:30 -08:00
Jakub Konka
7e0e27e738
libstd: add missing MachO rebase opcodes in macho.zig
2021-01-08 23:41:51 +01:00
Jay Petacat
e72472d953
io: FindByteOutStream to FindByteWriter
...
See #4917
2021-01-08 16:54:56 -05:00
Jay Petacat
1595ce273e
Remove deprecated stream aliases
2021-01-08 16:54:56 -05:00
Timon Kruiper
56c059077c
stage2: add initial impl of control flow in LLVM backend
...
The following TZIR instrutions have been implemented in the backend:
- all cmp operators (lt, lte, gt, gte, eq, neq)
- block
- br
- condbr
The following LLVMIR is generated for a simple assert function:
```
define void @assert(i1 %0) {
Entry:
%1 = alloca i1, align 1
store i1 %0, i1* %1, align 1
%2 = load i1, i1* %1, align 1
%3 = xor i1 %2, true
br i1 %3, label %Then, label %Else
Then: ; preds = %Entry
call void @llvm.debugtrap()
unreachable
Else: ; preds = %Entry
br label %Block
Block: ; preds = %Else
ret void
}
```
See tests for more examples.
2021-01-08 19:30:52 +01:00
Timon Kruiper
3715ed7b54
stage2: implement TZIR printing for block and condbr
...
Zig code:
```
fn assert(ok: bool) void {
if (!ok) unreachable;
}
```
TZIR:
```
Module.Function(name=assert):
@0: void = {};
%0: bool = arg(ok)
%1: void = dbg_stmt()
%2: void = block(
%3: bool = not(%0)
%4: noreturn = condbr(%3,
then:
%5: void = breakpoint()
%6: noreturn = unreach()
else:
%7: noreturn = br(%2, @0)
)
)
%8: noreturn = retvoid()
```
2021-01-08 12:13:27 +01:00
Julius Putra Tanu Setiaji
2b3b355a23
Add compileError message for StringHashMap in AutoHashMap
2021-01-07 23:51:53 -08:00
Andrew Kelley
3fdffe85c0
Merge pull request #7720 from Snektron/sockopt
...
Some sockopt stuff
2021-01-07 23:50:34 -08:00
Jonathan Marler
31802c6c68
remove z/Z format specifiers
...
Zig's format system is flexible enough to add custom formatters. This PR removes the new z/Z format specifiers that were added for printing Zig identifiers and replaces them with custom formatters.
2021-01-07 23:49:22 -08:00
Jay Petacat
a9b505fa77
Reduce use of deprecated IO types
...
Related: #4917
2021-01-07 23:48:58 -08:00
Michael Dusan
8e9a1ac364
builder: propagate env_map for child processes
2021-01-07 23:48:24 -08:00
Jakub Konka
70771283c5
Want native headers when linking with frameworks
...
This PR ensures we use system libc headers and system search paths for
framework headers when linking against frameworks and compiling natively
on macOS.
2021-01-07 23:47:37 -08:00
Robin Voetter
ec7adeda2b
Add EPERM to std.os.setsockopt
2021-01-08 02:34:42 +01:00
Robin Voetter
83fad7d4f7
Add IP_ constants
2021-01-08 01:35:52 +01:00
Andrew Kelley
c7666ff885
ci: import the update-download-page from www repo
2021-01-07 16:49:13 -07:00
Andrew Kelley
d8eba037a4
ci: fix path to update-download-page.zig script
2021-01-07 15:49:43 -07:00
Andrew Kelley
aa2422e830
ci: add github.com's public key for the ssh clone
2021-01-07 12:28:55 -07:00
Timon Kruiper
36950815a4
stage2 test: make sure to pass the dynamic linker to Compilation
...
Because this was not set, the `-dynamic-path` argument was not passed
to LLD when linking an ELF binary. This would still generate a valid glibc
binary, however when executing would result in a segfault.
2021-01-07 11:37:52 +01:00
Andrew Kelley
87aa052e23
ci: pass --override-lib-dir to emit std lib docs
...
Otherwise we get errors from conflicting std libs.
2021-01-07 02:58:27 -07:00
Andrew Kelley
ee1b370404
ci: don't use ninja on linux
...
I got this error when re-running the cmake line setting
-DZIG_EXECUTABLE:
```
ninja: warning: multiple rules generate zig1.o. builds involving
this target will not be correct; continuing anyway
[-w dupbuild=warn]
```
But it works fine with make.
2021-01-07 00:38:48 -07:00
Andrew Kelley
a279cf81b2
ci: add missing target/mcpu args to zig cc
...
In the previous commit, I forgot to add these.
2021-01-07 00:18:28 -07:00
Andrew Kelley
ce5222d945
ci: rework linux script
...
* no longer depend on apt.llvm.org, instead we rely on a zig-bootstrap
tarball with pre-built Zig, LLVM, LLD, and Clang. Similar to the
Windows Dev Kit but for Linux. This also makes the script no longer
depend on Docker, libxml2, or GCC.
* remove bash retry logic; it was only needed for flaky apt.llvm.org
and isn't needed for the other resources we download.
* build and upload the experimental std lib automatically generated
docs. langref.html is moved to docs/langref.html because the std lib
docs are in docs/std/.
* the superfluous "zig" directory in $prefix/lib/zig/std/std.zig is
removed from the tarball.
* update_download_page makes a commit in the www.ziglang.org repository
updating data/releases.json so that repository can manage deploys.
2021-01-06 23:40:17 -07:00
Jonathan Marler
f1ef0a80f1
fix LRESULT and LPARAM typedefs
...
LRESULT and LPARAM are currently typedef'd as ?*c_void, however, they are supposed to be typedef'd as LONG_PTR which is equivalent to isize in Zig.
2021-01-06 16:41:40 -08:00
Andrew Kelley
5ee0431527
stage2: update to new ArrayListHashMap API
2021-01-06 17:40:25 -07:00
Andrew Kelley
2f58efcc1f
std.SpinLock: flatten and remove init/deinit
...
structs which are intended to be directly initialized and support static
initialization should not have init/deinit methods.
2021-01-06 17:36:06 -07:00
Andrew Kelley
d7d905696c
Merge pull request #7622 from tetsuo-cpp/array-hash-map-improvements
...
std: Support equivalent ArrayList operations in ArrayHashMap
2021-01-06 16:32:23 -08:00
Andrew Kelley
76870a2265
Merge pull request #7700 from FireFox317/more-stage2-stuff-llvm
...
stage2: improvements to LLVM backend
2021-01-06 16:06:32 -08:00
BinaryWarlock
148c887ace
spinlock: Default SpinLock.state to .Unlocked to allow default struct initialization
...
std.Mutex, which is struct initialized, is possibly defined to be std.SpinLock.
2021-01-06 15:54:30 -08:00
Andreas Karlsson
50af87a9e3
Fix example code in comments for asc and desc
2021-01-06 15:53:53 -08:00
joachimschmidt557
be6ac82ee1
stage2 ARM: fix stack offsets for genSetReg and genSetStack
2021-01-06 15:53:10 -08:00
joachimschmidt557
480d6182ad
stage2 ARM: fix offsets in exitlude jump relocations
2021-01-06 15:53:10 -08:00
Frank Denis
5afd6204e8
Azure CI: update MSYS version
2021-01-06 15:52:34 -08:00
Andrew Kelley
efe94a9a12
stage2: C backend: support unused Decls
2021-01-06 16:47:09 -07:00