Commit Graph

7010 Commits (4dae70e702f10c385be1dea552f3d6e815dc93c9)

Author SHA1 Message Date
Andrew Kelley 3644e85091 fix regressions on windows 2019-12-01 21:31:00 -05:00
Andrew Kelley 37caa56fbc
fix docs regressions 2019-12-01 21:27:55 -05:00
Andrew Kelley c32e50f505
fix regressions in compile error tests 2019-12-01 20:53:24 -05:00
Andrew Kelley 4af5c38674
fixes for self-hosted compiler 2019-12-01 19:22:03 -05:00
Andrew Kelley 080316cd4f
fix assigning to an unwrapped optional field in an inline loop 2019-12-01 18:55:35 -05:00
Andrew Kelley c2cee40aec
add advanced IR debugging support
and use it to improve copy_const_val with regards to parent backrefs
2019-12-01 17:09:11 -05:00
Andrew Kelley 8524404f71
this test isn't passing in master branch either 2019-12-01 16:39:30 -05:00
Andrew Kelley 78811ff4ac
Merge remote-tracking branch 'origin/kill-ConstGlobalRefs' into remove-array-type-coercion 2019-12-01 09:58:32 -05:00
Andrew Kelley b36c07a95a
Merge remote-tracking branch 'origin/master' into remove-array-type-coercion 2019-12-01 09:56:01 -05:00
Andrew Kelley 4b6740e19d
sometimes free stuff from Zig IR pass 1
Total bytes used in stage1 std lib tests:
3.418 -> 3.198 GiB (saving 225 MiB)

There's still this from pass 1 not getting freed:
Const: 6909049 items, 72 bytes each, total 474.407 MiB

This is due to 2 things hanging on to references to IrAnalyze pointers:
 * ZigVar->owner_exec->analysis
 * LazyValue->ira

The LazyValue one could be solved by memoizing the results after the
lazy value is resolved, and then it could unref the IrAnalyze.

ZigVars that are determined to be comptime const, could have their
const_value set to that value, instead of using the mem_slot_index
mechanism. This would prevent an IrAnalyze ref in some cases.
2019-12-01 01:13:21 -05:00
Andrew Kelley b5df18c8fd
inline ConstGlobalRefs into ZigValue
Having ConstGlobalRefs be a pointer in ZigValue was a hack that caused
plenty of bugs. It was used to work around difficulties in type coercing
array values into slices.

However, after #3787 is merged, array values no longer type coerce into
slices, and so this provided an opportunity to clean up the code.

This has the nice effect of reducing stage1 peak RAM usage during the
std lib tests from 3.443 GiB to 3.405 GiB (saving 39 MiB).

There is one behavior test failing in this branch, which I plan to debug
after merging #3787.
2019-12-01 00:29:16 -05:00
Andrew Kelley 5026b1aad5
free IrAnalyze sometimes
Total bytes used in stage1 std lib tests:
3.443 GiB -> 3.418 GiB
2019-11-30 23:57:48 -05:00
Andrew Kelley 951dc451d6
Merge pull request #3808 from LemonBoy/i386-for-ya
linux-i386 support
2019-11-30 22:00:00 -05:00
Andrew Kelley 11b8d3ce9d
Merge branch 'std.fs.File' 2019-11-30 18:37:00 -05:00
Andrew Kelley 2e7350140d
further clarify std.fs function docs 2019-11-30 18:36:47 -05:00
Andrew Kelley 034ccb4e4e add missing error code handling on Windows 2019-11-30 16:58:32 -05:00
LemonBoy cdeafe777a Eat shit and die mips 2019-11-30 21:36:16 +01:00
Andrew Kelley 413f9a5cfc
move `std.fs.Dir.cwd` to `std.fs.cwd`
update to non-deprecated std.fs APIs throughout the codebase

Related: #3811
2019-11-30 15:35:27 -05:00
LemonBoy 6f105b5ae7 Implement target_dynamic_linker for mips 2019-11-30 21:14:32 +01:00
Andrew Kelley d039fed831
introduce std.fs.Dir.openFile and std.fs.Dir.createFile
These functions have flags parameters which cover all the use cases. The
other functions are now deprecated.
2019-11-30 13:32:11 -05:00
LemonBoy d0c6728d59 Eat shit and die glibc 2019-11-30 18:55:22 +01:00
LemonBoy e1e06e6766 linux-i386 support 2019-11-30 16:13:33 +01:00
Andrew Kelley 85e1e3b95f
Merge pull request #3284 from Sahnvour/export_variables
Improved support for exporting variables
2019-11-30 00:25:52 -05:00
Andrew Kelley b220be7a33
more test regression fixes 2019-11-29 23:04:19 -05:00
Andrew Kelley f980c29306
fix typo in error note for integer casting 2019-11-29 22:33:55 -05:00
Andrew Kelley d87b13f2f7
fix windows std lib regressions 2019-11-29 21:55:27 -05:00
Andrew Kelley 6936243ee1
fix self-hosted compiler regressions 2019-11-29 21:49:08 -05:00
Andrew Kelley 7278c51ddd
fix empty result location for parameters not working 2019-11-29 21:36:12 -05:00
Andrew Kelley 559bd27b08
fix `@bitCast` result coercing to error union by returning 2019-11-29 19:58:00 -05:00
Andrew Kelley 815b4cfd9d
fix return result loc as peer result loc in inferred error set function 2019-11-29 18:21:21 -05:00
Andrew Kelley a438a615e6
docs: this statement was in the wrong section 2019-11-29 12:41:07 -05:00
Andrew Kelley 2ab7f31e99
std.math: remove constants that should be expressions
All four of these can be represented in fewer characters with
expressions, which will be guaranteed to happen at compile-time, and
have the same or better precision.

The other math constants here which depend on function calls could be
similarly removed if and when #425 is solved. However I left them for
now since Zig does not eagerly evaluate functions with comptime parameters.
2019-11-29 10:48:46 -05:00
Andrew Kelley bcdb3a9006
more progress 2019-11-28 00:02:53 -05:00
Quetzal Bradley a6c9c5f767 implement correct buffer wrapping logic in std.event.Channel 2019-11-27 23:09:24 -05:00
Michael Dusan ca61a5f0b7 Windows: fix test/standalone/shared_library
- on Windows use first found env var { "Path", "PATH" }

Bug Description: `build test` results in the following error on in
a msys64 shell with "PATH" env var instead of "Path":

    error while loading shared libraries: mathtest.dll:
    cannot open shared object file: No such file or directory
2019-11-27 19:24:06 -05:00
Felix Queißner f0d6447569 Implements std.testing.expectEqual for tagged unions. (#3773) 2019-11-27 16:35:32 -05:00
Andrew Kelley 0f2a9af4aa
Merge pull request #3769 from MCRusher/initcapacity-for-buffer-arraylist
Add initCapacity for buffer & arraylist
2019-11-27 13:40:39 -05:00
Andrew Kelley 83c664eaa0
Merge pull request #3780 from Vexu/stage2-async-review
Update use of async functions in self hosted compiler
2019-11-27 13:38:49 -05:00
Andrew Kelley bf3ac66150
remove type coercion from array values to references
* Implements #3768. This is a sweeping breaking change that requires
   many (trivial) edits to Zig source code. Array values no longer
   coerced to slices; however one may use `&` to obtain a reference to
   an array value, which may then be coerced to a slice.

 * Adds `IrInstruction::dump`, for debugging purposes. It's useful to
   call to inspect the instruction when debugging Zig IR.

 * Fixes bugs with result location semantics. See the new behavior test
   cases, and compile error test cases.

 * Fixes bugs with `@typeInfo` not properly resolving const values.

 * Behavior tests are passing but std lib tests are not yet. There
   is more work to do before merging this branch.
2019-11-27 03:37:50 -05:00
Vexu 4d8a8e65df
add more workarounds 2019-11-27 10:17:37 +02:00
Andrew Kelley 63300a21dd
Merge branch 'kprotty-event_lock'
closes #3751
2019-11-26 21:08:25 -05:00
daurnimator 8a71f77c4a
std: lie about windows socklen_t signed-ness 2019-11-27 13:01:34 +11:00
daurnimator edc84e7ef7
std: add more winsock functions 2019-11-27 13:01:33 +11:00
daurnimator 19f26578c0
std: windows sockaddr constants come from ws2_32 2019-11-27 13:01:32 +11:00
daurnimator 8aa3d6019c
std: add windows.USHORT definition 2019-11-27 13:01:30 +11:00
daurnimator 254c79125b
std: fix WSAIoctl definition
zig automatically passes functions as pointers
2019-11-27 13:01:28 +11:00
daurnimator d99f0a2b8f
std: IO_STATUS_BLOCK's status member is an NTSTATUS; add union 2019-11-27 13:01:10 +11:00
daurnimator 1537d4701e
std: fix definition of NtDeviceIoControlFile 2019-11-27 13:01:09 +11:00
daurnimator a453c99ba9
std: add comments for some nt status codes 2019-11-27 13:01:08 +11:00
daurnimator 2c6788d7de
std: add windows.closesocket 2019-11-27 13:01:07 +11:00