Andrew Kelley
6f98ef09e3
Merge pull request #5717 from squeek502/fs-dir-file-ops
...
Add tests for using file operations on directories
2020-07-01 23:20:50 +00:00
Andrew Kelley
d2a4e5e226
Merge pull request #5749 from kubkon/wasi-notcapable
...
[libstd]: handle ENOTCAPABLE in WASI
2020-07-01 23:12:26 +00:00
Alexandros Naskos
30ae7f7573
Corrected default value field initialization in std.zeroInit
2020-07-01 23:09:08 +00:00
Chris Watson
b8d5b3e611
Add documentation for @src() builtin
2020-07-01 22:22:30 +00:00
CodeMyst
7eed220924
in docs removed "path can be absolute" for imports
2020-07-01 22:12:44 +00:00
Andrew Kelley
f69875d85c
build: -Dlib-files-only prevents self-hosted compiler from being built
...
closes #5756
2020-07-01 21:57:04 +00:00
Jakub Konka
8306826d53
Map ENOTCAPABLE into error.AccessDenied instead of error.NotCapable
...
This is direct result of review comments left by andrewrk and
daurnimator. It makes sense to map `ENOTCAPABLE` into a more generic
`error.AccessDenied`.
2020-06-30 18:21:38 +02:00
Jakub Konka
5bc99dd7e8
Fix more compilation errors
2020-06-29 21:42:11 +02:00
Jakub Konka
b96882c57a
Fix compilation errors
2020-06-29 18:09:22 +02:00
Jakub Konka
bf8bf528c6
Handle ENOTCAPABLE in WASI
...
This commit adds `error.NotCapable` enum value and makes sure that
every applicable WASI syscall that can return `ENOTCAPABLE` errno
remaps it to `error.NotCapable.
2020-06-29 17:10:01 +02:00
Jonathan Marler
67e97a1f0f
ArenaAllocator: use full capacity
2020-06-29 05:12:30 -04:00
Jonathan Marler
35e8876c23
Revert "arena_allocator: refactor and use full capacity"
...
This reverts commit e120b07a524f1accd4975f5206018c61c4be9345.
2020-06-29 05:12:30 -04:00
Andrew Kelley
1eed0cf0f3
zig fmt and delete unused type
2020-06-28 19:45:10 -04:00
Andrew Kelley
aa92446365
stage2: implement function parameters
...
In codegen.zig, the std.Target.Cpu.Arch is now generally available as a
comptime value where needed. This is a tradeoff that causes the compiler
binary to be more bloated, but gives us higher performance, since the
optimizer can optimize per architecture (which is usually how compilers
are designed anyway, with different code per-architecture), and it also
allows us to use per-architecture types, such as a Register enum that is
specific to the comptime-known architecture.
Adds abiSize method to Type.
2020-06-28 19:45:10 -04:00
Jonathan Marler
e120b07a52
arena_allocator: refactor and use full capacity
2020-06-28 18:40:15 -04:00
Jonathan Marler
c2eead9629
Fix issue 5741, use after free
2020-06-28 18:05:18 -04:00
Ryan Liptak
74c245aea9
Disable wasi 'readFileAlloc on a directory' assertion for now
2020-06-28 13:56:00 -07:00
Jonathan Marler
374e3e42e0
WasmPageAllocator: fix bug not aligning allocations
2020-06-28 14:25:39 -04:00
Andrew Kelley
581d16154b
Merge pull request #5696 from alexnask/async_call_tuple
...
@asyncCall now takes arguments as a tuple instead of varargs
2020-06-28 01:00:58 -04:00
Andrew Kelley
ac6bf53069
stage2: clean up test harness, implement symbol collision detection ( #5708 )
...
* Clean up test harness
* Stage2/Testing: Add convenience wrappers
* Add a `compiles` wrapper case
* fix incremental compilation after error
* exported symbol collision detection
* function redefinition detection for Zig code
* handle missing function names
* Stage2/Testing: Simplify incremental compilation tests
* Stage2/Testing: Update documentation
* Stage2/TestHarness: Improve progress reporting
* Disable test
* Improve Tranform failure output
2020-06-27 21:54:11 -04:00
Noam Preil
80b70470c0
Stage2/Module: Add symbol -> export lookup table
2020-06-27 21:50:59 -04:00
Noam Preil
ffca1569d1
Return instead of branch
2020-06-27 21:39:39 -04:00
Noam Preil
38d2c5cdf1
Rename type -> extension
2020-06-27 21:39:04 -04:00
Noam Preil
1861c25142
Improve Tranform failure output
2020-06-27 21:15:23 -04:00
Noam Preil
97c41e7152
Disable test
2020-06-27 21:10:44 -04:00
Noam Preil
54148a8c88
Stage2/TestHarness: Improve progress reporting
2020-06-27 20:01:20 -04:00
Andrew Kelley
0cfe8e5d6f
Merge pull request #5064 from marler8997/newAllocator
...
new allocator interface
2020-06-27 18:21:00 -04:00
Jonathan Marler
a728436992
new allocator interface after Andrew Kelley review
2020-06-27 08:57:35 -06:00
Noam Preil
ab307a22f6
Stage2: remove clearErrors, fix ZIR export collision detection
2020-06-27 07:17:20 -04:00
Ryan Liptak
626b5eccab
Move fs-specific tests from os/test.zig to fs/test.zig
...
The moved tests do not use `std.os` directly and instead use `std.fs` functions, so it makes more sense for them to be in `fs/test.zig`
2020-06-27 10:17:08 +00:00
Ryan Liptak
12aca758c6
Dir.deleteFile: Fix symlink behavior when translating EPERM to EISDIR
2020-06-26 17:12:02 -07:00
Ryan Liptak
505bc9817a
Implement Dir.deleteFile in terms of deleteFileZ/deleteFileW
...
Reduces duplicate code, consistent with other fn/fnZ/fnW implementations
2020-06-26 16:08:26 -07:00
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