Commit Graph

2812 Commits (78ba3b84850c1e1494797f76d147bc8c87f749e1)

Author SHA1 Message Date
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
tgschultz 3c9b6f8cd5 Fixed another incorrect comment 2018-04-18 19:57:47 -05:00
tgschultz fdebe38fa3 Added notes regarding CLOCK_MONOTONIC_RAW and made it easy to change our mind in the future.
Updated std.os imported tests' block with lazy declaration workaround and added time.zig.
Corrected some incorrect comments.
2018-04-18 19:48:19 -05:00
tgschultz 5c83d271a3 Fixed incorrect sign on epoch.clr 2018-04-18 18:50:28 -05:00
tgschultz 7cfe328a16 fixed typos. 2018-04-18 17:43:35 -05: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
tgschultz bf9cf28322 Fixed compiler errors around darwin code. 2018-04-18 15:46:50 -05:00
tgschultz 8b66dd8c7d Added unstaged changes. 2018-04-18 13:55:42 -05:00
tgschultz c90f936eef Added timestamp, high-perf. timer functions. 2018-04-18 13:52:25 -05: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
51a6ff18d4

closes #927
2018-04-16 22:33:34 -04:00
Marc Tiehuis c7cb5c31e5 Add exp/norm distributed random float generation 2018-04-16 20:06:50 +12:00
Andrew Kelley caefaf781e std.debug: dumpStackTrace & friends use DirectAllocator
this has the downside of failing to print a stack trace
when the system is out of memory (maybe we could add a
FallbackAllocator which tries DirectAllocator and falls
back on the 200KB preallocated buffer).

but for the more common use case when the system is not
out of memory, but the debug info cannot fit in
std.debug.global_allocator, now stack traces will work.

this is the case for the self hosted compiler.
2018-04-16 03:17:15 -04:00
Andrew Kelley 88724217dd
Merge pull request #925 from alexnask/release_small
Added ReleaseSmall mode.
2018-04-15 21:57:26 -04:00
Alexandros Naskos 1bc140964f Added ReleaseSmall mode to docgen 2018-04-16 04:18:52 +03:00
Alexandros Naskos 6492763bef Fixed test build code 2018-04-16 04:06:00 +03: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 859b10d8bf std.math.ln and std.math.exp use float strict mode
closes #920
2018-04-15 15:22:27 -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 fa05cab01a travis: put cache-control header for ziglang.org/download 2018-04-13 12:17:07 -04:00
Andrew Kelley 0509414dfe fix regression with zig install dir
introduced in 1999f0daad
2018-04-13 11:31:38 -04:00
Andrew Kelley 4662fd4d92
Merge pull request #919 from zig-lang/self-hosted-parser-refactor
Self-hosted parser refactor
2018-04-13 11:17:09 -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
Marc Tiehuis fe9489ad63 Fix windows access check 2018-04-13 22:50:57 +12:00
Marc Tiehuis 03bec631bd Replace File.exists with File.access 2018-04-13 21:27:09 +12:00
Jimmi Holst Christensen a498993fd1 Merged with master 2018-04-13 10:40:37 +02:00
Jimmi Holst Christensen 44c53c9979 std.zig.parser: Refactor round 2
* More work on ensuring that each state only eat one token
* VarDecl parsing now constructs its node
* Handling all fn parsing in the same case
* Using eatToken instead of getNextToken where possible
* All tokenIdTo* now takes  @TagType(Token.Id)
* Added a createToCtxLiteral function
2018-04-13 10:15:12 +02:00
Marc Tiehuis b946982e90 Use builtin Arch/Os/Environ 2018-04-13 20:12:30 +12:00
Marc Tiehuis 7fe1c7c04f Remove cc command 2018-04-13 19:43:18 +12:00
Andrew Kelley 0f652b4d80 zig fmt: switch cases on new lines
See #911
2018-04-12 21:56:12 -04:00
Andrew Kelley 9e701e951b zig fmt includes trailing commas
See #911
2018-04-12 21:40:15 -04:00
Andrew Kelley d4572d1140 zig fmt: container init fields each on own line
See #911
2018-04-12 21:23:18 -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
Jimmi Holst Christensen fad54e62bb std.zig.ast: Fixed build failures 2018-04-12 18:56:58 +02:00
Jimmi Holst Christensen d35a6655e0 std.zig.parser: Refactored `commaOrEnd` to `expectCommaOrEnd`
* Now it returns end when found, or null if comma was found.
* State should now be appended outside the function
2018-04-12 18:13:09 +02: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 c43f77f109 fix invalid implicit cast on macos 2018-04-12 10:38:32 -04:00
Jimmi Holst Christensen 206c0b8bdb std.zig.parser: Refactor, round 1:
* Removed the Optional state
  * We now have an OptionalCtx instead of DestPtr
  * OptionalCtx simulated return, instead of reverting states
  * OptionalCtx is a lot less hacky, but is still a small footgun
* Trying to avoid consuming more than one token per state
  * This is required, because of comments
  * The C++ compiler allows comments between all tokens
  * We therefor have to consume comment tokens between each state
* Reordered states so they are grouped in some logical fasion
2018-04-12 16:08:23 +02:00
Marc Tiehuis 803f0a295b Revise self-hosted command line interface
Commands are now separated more precisely from one another. Arguments
are parsed mostly using a custom argument parser instead of manually.
This should be on parity feature-wise with the previous main.zig but
adds a few extra code-paths as well that were not yet implemented.

Subcommands are much more prominent and consistent. The first argument
is always a sub-command and then all following arguments refer to that
command. Different commands display there own usage messages and options
based on what they can do instead of a one-for-all usage message that
was only applicable for the build commands previously.

The `cc` command is added and is intended for driving a c compiler. See #490.
This is currently a wrapper over the system cc and assumes that it
exists, but it should suffice as a starting point.
2018-04-12 22:28:47 +12:00
Jimmi Holst Christensen 0d8646d262 std.zig.parser now parses alignment of functions
Related #909
This allows it to parse `std/special/compiler_rt/index.zig`
2018-04-12 08:46:26 +02:00
Andrew Kelley 2b86ffe34a LLD patch: Do not keep shared symbols to garbage...
-collected eliminated DSOs.

This applies https://reviews.llvm.org/D45536 to the embedded
LLD.

Closes #883
2018-04-11 18:15:33 -04:00
Jimmi Holst Christensen ed1b028276 Merge branch 'master' of github.com:zig-lang/zig 2018-04-11 20:56:22 +02:00
Jimmi Holst Christensen 5b584e06e3 std.zig.parser special cased error in return.
Related #909
This allows parsing of `std/special/build_runner.zig`
2018-04-11 20:56:05 +02:00