Ryan Liptak
14c3c47fb7
fs.deleteFile: Translate to error.IsDir when appropriate on POSIX systems
...
Linux deviates from POSIX and returns EISDIR while other POSIX systems return EPERM. To make all platforms consistent in their errors when calling deleteFile on a directory, we have to do a stat to translate EPERM (AccessDenied) to EISDIR (IsDir).
2020-06-26 16:00:43 -07:00
Jonathan Marler
dc9648f868
new allocator interface
2020-06-26 13:34:48 -06:00
Andrew Kelley
bb55889ce0
README: add link to troubleshooting build issues wiki page
...
See #5673
2020-06-26 15:10:30 -04:00
Noam Preil
52787f2c9b
Fix a dumb
2020-06-26 06:52:29 -04:00
Noam Preil
6d536168b0
Stage2/Testing: Update documentation
2020-06-26 06:51:35 -04:00
Noam Preil
0e952a9f3a
Stage2/Testing: Simply incremental compilation tests
2020-06-26 05:00:53 -04:00
Noam Preil
c8f60b2e2f
Stage2: handle missing function names
2020-06-26 04:36:17 -04:00
Noam Preil
6510888039
Stage2: function redefinition detection for Zig code
2020-06-26 04:05:41 -04:00
Noam Preil
4a17e008da
Stage2: exported symbol collision detection
2020-06-26 03:17:13 -04:00
Noam Preil
e5a3cb8d71
Stage2: fix incremental compilation after error
2020-06-26 03:16:36 -04:00
Noam Preil
53fead580e
Add a compiles wrapper case
2020-06-26 03:09:56 -04:00
Ryan Liptak
0e3d74df8a
Add tests for using file operations on directories
2020-06-26 00:06:23 -07:00
Noam Preil
649da2df52
Stage2/Testing: Add convenience wrappers
2020-06-26 02:42:02 -04:00
Andrew Kelley
130c7fd23b
self-hosted: working towards conditional branching test case
...
New features:
* Functions can have parameters in semantic analysis. Codegen
is not implemented yet.
* Support for i8, i16, i32, i64, u8, u16, u32, u64 primitive
identifiers.
* New ZIR instructions: arg, block, and breakvoid
Implementation details:
* Move Module.Body to ir.Body
* Scope.Block gains a parent field and an optional Label field
* Fix bug in integer type equality comparison.
Here's the test case I'm working towards:
```
@void = primitive(void)
@i32 = primitive(i32)
@fnty = fntype([@i32, @i32], @void)
@0 = str("entry")
@1 = export(@0, "entry")
@entry = fn(@fnty, {
%0 = arg(0)
%1 = arg(1)
%2 = add(%0, %1)
%3 = int(7)
%4 = block("if", {
%neq = cmp(%2, neq, %3)
%5 = condbr(%neq, {
%6 = unreachable()
}, {
%7 = breakvoid("if")
})
})
%11 = returnvoid()
})
```
$ ./zig-cache/bin/zig build-obj test.zir
test.zir:9:12: error: TODO implement function parameters for Arch.x86_64
That's where I left off.
2020-06-26 02:30:14 -04:00
Andrew Kelley
e820678ca1
Merge pull request #5588 from tgschultz/leb128-output
...
LEB128 overhaul and output
2020-06-25 19:10:31 -04:00
Andrew Kelley
061c8be049
Merge pull request #5684 from squeek502/fs-file-dir-ops
...
Add tests for using directory operations on files
2020-06-25 19:08:30 -04:00
data-man
77bb2dc094
Use writer in benchmarks
2020-06-25 19:07:25 -04:00
Ryan Liptak
dcdbb7006c
Add tests for using directory operations on files
2020-06-25 03:49:58 -07:00
Ryan Liptak
f50ed94174
Windows: Fix fs.Dir.openDir not handling STATUS_NOT_A_DIRECTORY
...
Now correctly returns error.NotDir
2020-06-25 03:49:58 -07:00
Andrew Kelley
41c6cc9001
Merge pull request #5677 from kubkon/fstatat
...
[libstd]: implement fstatat in WASI plus fix on macOS
2020-06-25 00:01:38 -04:00
arbrk1
78d8931647
Fix issue #5618 ( #5685 )
...
* fix issue #5618
* A test for the issue #5618 added.
Also inserted a comma in the neighboring test to make it more zigfmt-friendly.
2020-06-24 23:58:50 -04:00
Alexandros Naskos
2fde8249b7
Fixed crash when resolving peer types of *[N:s]const T and [*:s]const T
2020-06-24 23:58:02 -04:00
Noam Preil
c88edbc46f
OOM -> catch unreachable
2020-06-24 23:34:58 -04:00
Noam Preil
5d7e981f95
Clean up test harness
2020-06-24 22:43:18 -04:00
Andrew Kelley
d337469e44
Merge pull request #5583 from ziglang/zig-ast-to-zir
...
self-hosted: hook up Zig AST to ZIR
2020-06-24 22:37:58 -04:00
Code Hz
7875649c24
Pdb.openFile use []const u8 instead of []u8
2020-06-24 22:27:30 -04:00
Andrew Kelley
20b4a2cf2c
self-hosted: add compare output test for new AST->ZIR code
2020-06-24 21:28:42 -04:00
Andrew Kelley
5aa3f56773
self-hosted: fix test regressions
...
I'm allowing incremental compilation of ZIR modules to be broken. This
is not a real use case of ZIR, and the feature requires a lot of code
duplication with incremental compilation of Zig AST (which works great).
2020-06-24 20:28:52 -04:00
Andrew Kelley
fd7a97b3b2
fix memory leak of anonymous decl name
2020-06-24 16:20:02 -04:00
Andrew Kelley
e42b7702eb
Merge remote-tracking branch 'origin/master' into zig-ast-to-zir
2020-06-24 15:36:59 -04:00
Alexandros Naskos
129a4fb251
Copy union const values correctly
2020-06-24 15:21:58 -04:00
Jakub Konka
d40e367b73
Reformat using if-else where appropriate
2020-06-24 21:00:21 +02:00
Jakub Konka
c63b23d684
Use fstatat on macOS (otherwise uses 32bit)
2020-06-24 21:00:21 +02:00
Jakub Konka
be78b7b648
Implement fstatat targeting WASI
...
Also, add more informative `@compileError` in a few `std.os` functions
that would otherwise yield a cryptic compile error when targeting
WASI. Finally, enhance docs in a few places and add test case for
`fstatat`.
2020-06-24 21:00:21 +02:00
Andrew Kelley
2c7fc1c5c5
Merge branch 'marler8997-fixAzureMsys2'
...
closes #5688
closes #5679
2020-06-24 14:53:02 -04:00
Andrew Kelley
489c31b6f5
azure ci: install tar and xz with pacman
2020-06-24 14:52:34 -04:00
Jonathan Marler
3a2cc5decf
azure-pipelines: fix msys2 install
2020-06-24 14:33:01 -04:00
antlilja
e60be30824
Remove unreachable else prongs
2020-06-24 19:03:32 +02:00
Alexandros Naskos
ff2ddcf38d
Updated @asyncCall docs
2020-06-24 19:01:38 +03:00
Alexandros Naskos
7f342451b6
Fixed @asyncCall in runtime safety test
2020-06-24 18:43:11 +03:00
antlilja
fd50696359
Store else node in IrInstSrcCheckSwitchProngs
...
* Remove have_else_prong (bool)
* Add else_prong (AstNode*)
2020-06-24 17:36:24 +02:00
Alexandros Naskos
eefcd04462
Small fixes, fixed tests, added test for argument tuple type
2020-06-24 16:56:24 +03:00
Alexandros Naskos
50b70bd77f
@asyncCall now requires an argument tuple
2020-06-24 14:07:39 +03:00
Andrew Kelley
14aa08fcd3
self-hosted: restore ZIR functionality
2020-06-24 03:46:32 -04:00
Andrew Kelley
3aab6012c4
Revert "building mingw-w64 for windows ARM looks in lib64/lib32 for .def files"
...
This reverts commit 93f0bcb649087b5db5cfcba5de5faaaf59047751.
This is not correct (from #mingw-w64 IRC):
<andrewrk> is there no .def file for ntdll on arm 64 bit?
<andrewrk> or does mingw-w64-crt/lib64/ntdll.def apply to both x86_64
and aarch64?
<wbs> andrewrk: there's none at the moment (as apps rarely link directly
against ntdll, and I didn't want to guess needlessly around that one
originally when I added arm64 support, before I actually had a real
arm64 windows device)
<wbs> andrewrk: but I guess I could/should complete that now
<wbs> (if you need one right now, the libarm32 one probably is the
closest match)
2020-06-24 02:08:08 -04:00
Andrew Kelley
93f0bcb649
building mingw-w64 for windows ARM looks in lib64/lib32 for .def files
2020-06-24 01:59:19 -04:00
Andrew Kelley
b1b7708cc8
self-hosted: hook up incremental compilation to .zig source code
2020-06-23 23:29:51 -04:00
Andrew Kelley
a1a1f94a0d
Merge pull request #5681 from kubkon/refactor-wasi-preopens
...
[libstd]: refactor std.fs.wasi.PreopenList.find()
2020-06-23 22:23:20 -04:00
Andrew Kelley
d9c1d8fed3
self-hosted: improve handling of anonymous decls
...
* anonymous decls have automatically generated names and symbols, and
participate in the same memory management as named decls.
* the Ref instruction is deleted
* the DeclRef instruction now takes a `[]const u8` and DeclRefStr takes
an arbitrary string instruction operand.
* introduce a `zir.Decl` type for ZIR Module decls which holds
content_hash and name - fields that are not needed for `zir.Inst`
which are created as part of semantic analysis. This improves the
function signatures of Module.zig and lowers memory usage.
* the Str instruction is now defined to create an anonymous Decl and
reference it.
2020-06-23 19:53:32 -04:00
Jakub Konka
5fed725e0a
Remove some leftover debugging checks
2020-06-23 23:59:32 +02:00