Andrew Kelley
bf8e419d2b
linux uses pthreads when linking against libc
2018-04-29 00:40:04 -04:00
Andrew Kelley
998e25a01e
pthread support working
2018-04-28 23:47:39 -04:00
Andrew Kelley
96ecb40259
add fuzz tests for std.atomic.Stack
2018-04-28 17:53:06 -04:00
Jimmi Holst Christensen
73bf897b5c
Using allocate instead of allocate_nonzero so we don't have to memset
2018-04-28 19:21:23 +02:00
Jimmi Holst Christensen
d6f033b42d
Fixed build error
2018-04-28 19:09:25 +02:00
Jimmi Holst Christensen
837166319d
Trying to fix osx build failing by setting param_info.type to nullptr
2018-04-28 19:02:46 +02:00
Jimmi Holst Christensen
341f8c1e86
Fixed wrong formatting for arg_index when reporting @ArgType error
2018-04-28 17:57:47 +02:00
Jimmi Holst Christensen
fba0347ec4
.ReturnType and @ArgType now emits errors on unresolved types
...
related: #846
2018-04-28 17:17:48 +02:00
Jimmi Holst Christensen
2fc34eaa58
Functions with infered error set can now return literals
...
fixes #852
2018-04-28 16:27:31 +02:00
Jimmi Holst Christensen
3178528335
Removed zero sized error set optimization
...
fixes #762
fixes #818
2018-04-28 14:05:08 +02:00
Andrew Kelley
15bf0c1541
fix interaction between defer and labeled break
...
closes #830
2018-04-23 18:06:33 -04:00
Andrew Kelley
89a4c373d3
fix bigint twos complement implementation
...
closes #948
2018-04-23 12:06:18 -04:00
Andrew Kelley
8503eff8c1
add compile error for invalid deref on switch target
...
closes #945
2018-04-22 23:46:55 -04:00
Andrew Kelley
75328e3204
exit(1) instead of abort() for file not found
2018-04-22 21:47:25 -04:00
Andrew Kelley
25dff91fa0
fix windows build broken by previous commit
...
fixes build failure from 1c41f1ca6252faaa7750936c67562f1866a48075
2018-04-22 21:08:52 -04:00
Andrew Kelley
1c41f1ca62
better error reporting for missing libc on windows
...
closes #931
2018-04-22 20:54:52 -04:00
Andrew Kelley
21767144fc
linux: support VDSO for clock_gettime
...
also fix a compiler crash when using cmpxchg with nullable pointer
2018-04-22 18:11:50 -04:00
Andrew Kelley
6e57243a79
zig fmt: preserve comments in front of test blocks
...
* refactor std.zig.parser
* fix compiler crashing for some compile errors
* take advantage of @field in std.zig.ast
* move ast.NodeFoo to ast.Node.Foo
* comment preservation is more explicit
See #911
2018-04-20 02:15:09 -04:00
Jimmi Holst Christensen
1b91478bff
Optimized field ptr ir for hot path and fix assignment bug
2018-04-19 21:34:18 +02:00
Jimmi Holst Christensen
6b4f6ebd89
Added field builtin function
2018-04-19 20:11:16 +02:00
Andrew Kelley
06909ceaab
support break in suspend blocks
...
* you can label suspend blocks
* labeled break supports suspend blocks
See #803
2018-04-18 22:21:54 -04:00
Andrew Kelley
ca4341f7ba
add --no-rosegment cli option
...
this provides a workaround for #896
until valgrind adds support for clang/LLD
(equivalent to gcc/gold -rosegment)
2018-04-18 17:14:09 -04:00
Andrew Kelley
f1f998e071
improve cmpxchg
...
* remove @cmpxchg, add @cmpxchgWeak and @cmpxchgStrong
- See explanations in the langref.
* add operand type as first parameter
* return type is ?T where T is the operand type
closes #461
2018-04-18 12:16:42 -04:00
Andrew Kelley
96ebd8b23b
fix windows not respecting --msvc-lib-dir, --kernel32-lib-dir
...
I believe this was a regression caused by
51a6ff18d454f4cb0faa0f1837df9f0c55a80b43
closes #927
2018-04-16 22:33:34 -04:00
Alexandros Naskos
1c85050dad
Set SizeLevel to 2 in ReleaseSmall mode
2018-04-16 03:54:40 +03:00
Alexandros Naskos
253ecd5c11
Added ReleaseSmall mode
2018-04-16 03:26:10 +03:00
Andrew Kelley
b9360640ce
add @atomicLoad builtin
...
See #174
2018-04-15 18:12:00 -04:00
Andrew Kelley
a8d794215e
exit with error code instead of panic for file not found
2018-04-15 15:22:07 -04:00
Andrew Kelley
b5459eb987
add @sqrt built-in function
...
See #767
2018-04-15 13:26:58 -04:00
Andrew Kelley
4a2bfec150
fix linux implementation of self exe path
...
closes #894
2018-04-15 12:57:45 -04:00
Andrew Kelley
b7af9edb8a
add std.os.createThread
...
this adds kernel thread support to the standard library for
linux.
See #174
2018-04-14 02:24:05 -04:00
Andrew Kelley
0509414dfe
fix regression with zig install dir
...
introduced in 1999f0daad505
2018-04-13 11:31:38 -04:00
Andrew Kelley
30c5f3c441
Merge pull request #915 from zig-lang/self-hosted-cli
...
Revise self-hosted command line interface
2018-04-13 11:16:06 -04:00
Andrew Kelley
1999f0daad
fix undefined behavior triggered by fn inline test
...
LLVM destroys the string that we use to test if LLVM deleted the
inlined function.
Also fixed forgetting to initialize a buffer in std lib path detection.
2018-04-13 11:10:17 -04:00
Andrew Kelley
373b3586a1
inline functions must be stored in const or comptime var
...
closes #913
2018-04-12 16:26:23 -04:00
Andrew Kelley
29e0e4088e
Merge remote-tracking branch 'origin/master' into self-hosted-cli
2018-04-12 11:20:38 -04:00
Andrew Kelley
7b2cb7e679
remove --zig-install-prefix arg now that we find std at runtime
2018-04-12 11:00:11 -04:00
Andrew Kelley
e48e707c32
allow integer and float literals to be passed to var params
...
closes #623
2018-04-11 14:47:37 -04:00
Andrew Kelley
e85a10e9f5
async tcp server proof of concept
2018-04-09 00:52:45 -04:00
Andrew Kelley
acd8f6ef18
fixups from rebase
2018-04-08 18:49:20 -04:00
Andrew Kelley
b85ef656ca
running into the llvm corosplit error again
2018-04-08 18:30:54 -04:00
Andrew Kelley
0d22a00f6f
*WIP* async/await TCP server
2018-04-08 18:26:24 -04:00
Andrew Kelley
ee1a4f4c1d
error return traces work with async return case
2018-04-08 17:44:29 -04:00
Andrew Kelley
9e98ea552d
fix calling convention at callsite of zig-generated fns
2018-04-08 16:40:59 -04:00
Andrew Kelley
ada441157f
put the error return addresses in the coro frame
2018-04-08 16:04:48 -04:00
Andrew Kelley
e4083b7391
codegen: fix not putting llvm allocas together
2018-04-08 16:04:48 -04:00
Andrew Kelley
d26905c102
error return traces for the early return case
...
it would work but LLVM is not correctly spilling the addresses.
See #821
2018-04-08 16:04:48 -04:00
Ben Noordhuis
8980281184
fix llvm assert on version string with git sha
...
LLVM's CodeViewDebug pass misparses the version string when it contains
a git revision so stop doing that. This only affected Windows builds.
closes #898
2018-04-06 00:31:55 +02:00
Marc Tiehuis
2e5115b068
Add run compiler command
...
'zig run file.zig' builds a file and stores the artifacts in the global
cache. On successful compilation the binary is executed.
'zig run file.zig -- a b c' does the same, but passes the arguments a,
b and c as runtime arguments to the program. Everything after an '--' are
treated as runtime arguments.
On a posix system, a shebang can be used to run a zig file directly. An
example shebang would be '#!/usr/bin/zig run'. You may not be able pass
extra compile arguments currently as part of the shebang. Linux for example
treats all arguments after the first as a single argument which will result
in an 'invalid command'.
Currently there is no customisability for the cache path as a compile
argument. For a posix system you can use `TMPDIR=. zig run file.zig` to
override, in this case using the current directory for the run cache.
The input file is always recompiled, even if it has changed. This is
intended to be cached but further discussion/thought needs to go into
this.
Closes #466 .
2018-04-01 17:03:06 +12:00
Andrew Kelley
67f11190d1
musl-friendly dynamic linking
2018-03-31 16:34:55 -04:00