Commit Graph

4734 Commits (4c03746926562e4e9650eec7c4361836fabba5af)

Author SHA1 Message Date
Shritesh Bhattarai 6cc2d3938e support comptime_int in formatInt{,Value} 2019-04-05 11:11:04 -04:00
Jay Weisskopf 3cce56af99 docs: Use section symbol §, not paragraph symbol ¶
A header may cover more than one paragraph, so a section symbol is more appropriate. 

https://en.wikipedia.org/wiki/Section_sign
2019-04-05 11:09:38 -04:00
vegecode c24a49a1a7 Fixes to divsf3 (#2186)
* Fixes to divsf3

Embarrassingly failed to notice a section that was unchanged from where
it was copied from mulXf3.zig. The test cases for this function series
div{s,d,t}f3 are very incomplete and don't exercise all code paths.

Remove unnecessary switch from divsf3 left during development from when
I tried to make it generic to support f32, f64, and f128 in one go.

Make runtime safety dependent on whether a test is being run.

* divsf3: switch plus to minus
2019-04-05 11:04:46 -04:00
Shawn Landden aecbd1892a Simplify math.isnan
We can just rely on the builtin behavior.
2019-04-05 11:03:57 -04:00
Andrew Kelley 1dc6751721
fix NaN comparing equal to itself
This was broken both in comptime code and in runtime code.

closes #1174
2019-04-04 22:07:15 -04:00
Shritesh Bhattarai 8e6ff8d615 fmt: format multi line only on trailing comma (#2184)
* fmt: format multi line only on trailing comma
2019-04-04 19:33:32 -04:00
Andrew Kelley 5866dfe4d9
Merge pull request #2109 from emekoi/fix-mingw
fixed libc command on mingw
2019-04-04 15:55:40 -04:00
Andrew Kelley be0f656c21
fix `@divFloor` returning incorrect value and add `__modti3`
Closes #2152
See #1290
2019-04-04 15:45:37 -04:00
vegecode 12c4ab3927 Add divsf3 to compiler rt 2019-04-04 15:38:09 -04:00
Andrew Kelley 7dd1e0fc2b
docs: add Variables section
closes #1927
2019-04-04 12:26:47 -04:00
Andrew Kelley c195d645e4
add regression test for #1025
closes #1025
2019-04-04 01:45:18 -04:00
Andrew Kelley 947c87b558
threads: fix using unmapped memory in some cases
as pointed out in #musl IRC, the memory for the fs register address
value needs to be taken into account in the mmap call.
2019-04-04 01:36:01 -04:00
hryx e827b9661b zig fmt: Prevent for-else on same line when body is interrupted by LF 2019-04-04 01:31:39 -04:00
hryx cec8c8678a zig fmt: Fix regression in for-else (#2178) 2019-04-04 01:31:39 -04:00
Andrew Kelley 90b6eab05a
docs: complete the documentation for extern struct
closes #1522
2019-04-04 01:23:41 -04:00
Andrew Kelley e4d595a8ba
fix thread local variables for non- position independent code
This fixes comes thanks to Rich Felker from the musl libc project,
who gave me this crucial information:

"to satisfy the abi, your init code has to write the same value
to that memory location as the value passed to the [arch_prctl]
syscall"

This commit also changes the rules for when to build statically
by default. When building objects and static libraries, position
independent code is disabled if no libraries will be dynamically
linked and the target does not require position independent code.

closes #2063
2019-04-04 01:08:26 -04:00
Ruslan Prokopchuk 70ae3222b5 handle LibExeObjStep.disable_gen_h
It is sometimes useful to skip generating of the header file (e.g. https://github.com/ziglang/zig/issues/2173), and zig compiler provides an option `--disable-gen-h` to control that behaviour. However, setting `lib.disable_gen_h = true` in a typical `build.zig` didn't append the option to arguments. This commit fixes it and adds a convenient `setDisableGenH` setter.
2019-04-03 18:31:25 -04:00
Andrew Kelley 4795f161e6
Merge pull request #2175 from tgschultz/stdlib-serialization-minor_changes
Minor changes to serializer/deserializer
2019-04-03 18:13:25 -04:00
Andrew Kelley b60f2d0c9f
langref: rework the theming and layout
* Instead of the only color scheme being dark, the language reference
   now has a light theme by default, and respects the user's light/dark
   preference via prefers-color-scheme media query. Most browsers don't
   support this yet, so we just have to wait patiently for the future to
   arrive. closes #2172.

 * Instead of a side bar index, the index is inline with the rest of the
   content. This is simpler and more friendly to all user agents, and means
   we don't need the media query for mobile devices. It also makes
   back-references work, so now headers link to the table of contents
   and the table of contents links to headers.
2019-04-03 17:39:07 -04:00
tgschultz fe33d8ea14 Changes as suggested by andrewrk 2019-04-03 20:05:24 +00:00
Andrew Kelley 692086f898
ci: add missing cache control headers and update download/index.json 2019-04-03 16:04:24 -04:00
tgschultz ba774c5697 (De)serializer now uses enum instead of bool to determine packing mode (byte/bit).
Optional is initialized in a more straight-forward way by deserializer.
2019-04-03 15:47:46 +00:00
Andrew Kelley 85edf55b73
Merge pull request #2135 from ziglang/decouple-llvm-types
decouple llvm types from zig types
2019-04-02 23:17:17 -04:00
Andrew Kelley 025a1475c4
emit better debug info for enums
fixes llvm assertion when building for windows
2019-04-02 19:40:33 -04:00
Andrew Kelley 6a7b75b73c
fix LLVM assertion failures 2019-04-02 19:09:25 -04:00
Andrew Kelley 15bd4aa54f fix setting union body twice 2019-04-02 18:43:25 -04:00
Andrew Kelley e9dc504141
avoid tripping assertion for setting struct body twice 2019-04-02 18:31:19 -04:00
Andrew Kelley d577dde636
passing all tests 2019-04-02 18:31:19 -04:00
Andrew Kelley 9780fd59f0
put the alignment hack in for unions too. fixes std tests 2019-04-02 18:31:19 -04:00
Andrew Kelley cb0241fe44
behavior tests passing again 2019-04-02 18:31:19 -04:00
Andrew Kelley 4c38a8cce1
more regression fixes. empty test passes again 2019-04-02 18:31:19 -04:00
Andrew Kelley 5aee17e888
regression fixes and fix packed struct abi size 2019-04-02 18:31:19 -04:00
Andrew Kelley ddb8aa73f5
more regression fixes 2019-04-02 18:31:18 -04:00
Andrew Kelley 30b2fb2fb5
bug fixes 2019-04-02 18:31:18 -04:00
Andrew Kelley d7bc7635c0
put the hack from master branch back in 2019-04-02 18:31:18 -04:00
Andrew Kelley d3f2fe2cef
remove the lazy value stuff
let's try to keep this branch to solving one problem at a time
2019-04-02 18:31:18 -04:00
Andrew Kelley 3dc8448680
introduce lazy values
but I think it's a bad idea, so I'm going to back out the change
2019-04-02 18:31:18 -04:00
Andrew Kelley ee5064c053
decouple llvm types from zig types
Not tested yet, but it builds.

This closes #761, and lays the groundwork for fixing the remaining
false positive "foo depends on itself" bugs, such as #624.

It also lays the groundwork for implementing ability to specify
alignment of fields (#1512).
2019-04-02 18:31:17 -04:00
Andrew Kelley 2f96c55095 fix cache hash regression
fixes "warning: unexpected seek failure"

fix regression introduced by 27e31f0475

the fd should be closed only if returning with an error
2019-04-02 15:29:16 -04:00
Andrew Kelley 0cccba71d4
better error message when os_file_overwrite fails 2019-04-02 15:21:08 -04:00
Shawn Landden 27e31f0475 fix fd leak in stage1 cacheing code 2019-04-02 12:27:14 -04:00
Andrew Kelley 3c27d9c25a
Merge pull request #2147 from emekoi/fix1940
added error for implicit cast from *const T to *[1]T.
2019-04-01 11:35:03 -04:00
Andrew Kelley 3199792ade
Merge pull request #2150 from vegecode/armv7m-compiler-rt
Armv7m compiler rt
2019-04-01 11:31:57 -04:00
hryx c76d51de97 zig fmt: Allow one-line for loops 2019-04-01 11:31:00 -04:00
Shritesh Bhattarai d645500883 fmt: fix first line comment indent in struct init 2019-03-31 22:33:32 -04:00
vegecode bfbfb7b3b0 Remove inline keywords in addXf3.zig pending #2154 2019-03-31 21:00:36 -05:00
hryx 0563e8e1d4 Always write a multiline struct literal if a field expr is multiline 2019-03-31 21:09:56 -04:00
emekoi b7aa289ae4 fixed broken casts in std 2019-03-31 16:47:34 -05:00
emekoi 4a64f26627 added error for implicit cast from *const T to *[1]T. credit: @kristate 2019-03-31 16:47:34 -05:00
Michael Dusan aa794eb621 fix zig run to accept executable args
The `--` double-hyphen is now used to end further `zig` processing
of command line options. All arguments after `--` will be passed
on to the executable. eg. `--help` will be passed on.

`zig run foo.zig -- --help`

closes #2148
2019-03-31 17:01:11 -04:00