Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

result location mechanism (part of no-copy semantics) #2602

Merged
merged 132 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
5e1003b
no-copy semantics for basic runtime function call variable init
andrewrk May 1, 2019
a4aca78
no-copy semantics for if expr
andrewrk May 30, 2019
95d9835
no-copy semantics for nested if
andrewrk May 31, 2019
3702c27
local consts with comptime init exprs
andrewrk May 31, 2019
8aba064
peer result locations with mixed runtime/comptime
andrewrk May 31, 2019
461382a
no-copy semantics for function call init var and literal
andrewrk May 31, 2019
ccce3d8
no-copy semantics for function forwarding
andrewrk May 31, 2019
735543d
add missing ir_expr_wrap calls
andrewrk Jun 3, 2019
eb8a132
var types, alignment, and comptime
andrewrk Jun 3, 2019
b6108ee
fix alignment of consts
andrewrk Jun 3, 2019
d4054e3
while loops
andrewrk Jun 4, 2019
143d6ad
no-copy semantics for for loops
andrewrk Jun 4, 2019
a32abcd
no-copy semantics for if optional and if error union
andrewrk Jun 4, 2019
057b960
fix the rest of the ir_build_alloca_src callsites
andrewrk Jun 4, 2019
b19b1c1
no-copy semantics for switch expressions
andrewrk Jun 4, 2019
76a3938
no-copy semantics for peer result function calls
andrewrk Jun 7, 2019
4c222a4
fix behavior for non sret fn calls
andrewrk Jun 7, 2019
ec17f4e
fix behavior for peer result locs with one prong unreachable
andrewrk Jun 7, 2019
0e8b65c
hook up peer result locs to if optional and if err
andrewrk Jun 7, 2019
ec8d8a9
hook up while on error unions with result locations
andrewrk Jun 7, 2019
ede3436
hook up peer result locs to while bool and optional
andrewrk Jun 7, 2019
2b0a1b7
hook up result locs to for loops
andrewrk Jun 7, 2019
b1efba0
hook up peer result locs to catch
andrewrk Jun 7, 2019
a2fff26
hook up peer result locs to orelse keyword
andrewrk Jun 8, 2019
52eb347
hook up result locs for `try`
andrewrk Jun 8, 2019
771e889
result location mechanism for struct initialization
andrewrk Jun 8, 2019
3ec766a
remove ResultLocField dead code
andrewrk Jun 9, 2019
59fe137
result loc semantics for array initialization
andrewrk Jun 9, 2019
3a4b749
Merge remote-tracking branch 'origin/master' into copy-elision-3
andrewrk Jun 9, 2019
4e2b282
inferred array size of array literals works
andrewrk Jun 9, 2019
1a51bf6
hook up result locations for union initializations
andrewrk Jun 10, 2019
17b1ac5
result location semantics for `@bitCast`
andrewrk Jun 10, 2019
c362895
result location semantics for slices
andrewrk Jun 10, 2019
eaa9d8b
result location semantics for optional wrap
andrewrk Jun 10, 2019
4f085b8
result location semantics for error union wrapping a payload
andrewrk Jun 10, 2019
b9c033a
result location semantics for error union wrapping an error
andrewrk Jun 10, 2019
ee3f7e2
result location semantics for cmpxchg
andrewrk Jun 10, 2019
65f6ea6
result loc semantics for `@sliceToBytes` and `@bytesToSlice`
andrewrk Jun 10, 2019
9a324ec
result loc semantics for loading packed struct pointer to packed struct
andrewrk Jun 10, 2019
4582ec5
result location semantics for vector to array
andrewrk Jun 10, 2019
a0427d2
fix peer result locations in the face of unreachable
andrewrk Jun 11, 2019
f6d4e25
use result loc for ref instruction
andrewrk Jun 11, 2019
d504318
remove the final legacy stack allocation
andrewrk Jun 11, 2019
33371ab
Merge remote-tracking branch 'origin/master' into copy-elision-3
andrewrk Jun 11, 2019
7411a88
fix comptime function calls
andrewrk Jun 11, 2019
b053a65
fix comptime variables
andrewrk Jun 11, 2019
a431a73
fixes for crashes and compile errors
andrewrk Jun 11, 2019
06f307f
fix implicit casting return value struct/arary init to optional
andrewrk Jun 11, 2019
fc8d881
fix struct and array init when result casted to anyerror!?T
andrewrk Jun 11, 2019
1c2e889
fix struct and array init when result casted to anyerror!?T
andrewrk Jun 11, 2019
5150922
fix not checking return value of resolving result
andrewrk Jun 11, 2019
0ac5668
fix for loop index variable not in scope
andrewrk Jun 11, 2019
60c3861
temporarily simplify test_runner.zig
andrewrk Jun 11, 2019
e1d14e7
fix `@bitCast` semantics when there is no parent result loc
andrewrk Jun 11, 2019
b3a4ec1
fix returning scalar values
andrewrk Jun 11, 2019
ce5d50e
fix runtime if nested inside comptime if
andrewrk Jun 11, 2019
278c7a2
fix `@bitCast` regressions
andrewrk Jun 12, 2019
35352e0
fix alignment problem with `@bitCast` result location
andrewrk Jun 12, 2019
1526d89
fix `@bitCast` with runtime scalar and dest result loc var
andrewrk Jun 12, 2019
e6fa2ee
fix nested peer result locs with no memory loc
andrewrk Jun 12, 2019
0d62c92
fix declref not writing to result loc
andrewrk Jun 12, 2019
cdf14ba
fix double nested peer result locations
andrewrk Jun 13, 2019
b552e68
fix result loc implicit casting optionals and error unions
andrewrk Jun 13, 2019
ca0988e
comment out the behavior tests that are failing
andrewrk Jun 13, 2019
efb0644
fix runtime initialize array elem and then implicit cast to slice
andrewrk Jun 13, 2019
3cbe827
fix behavior for nested array literals
andrewrk Jun 13, 2019
24cfa35
allow comptime array literals casted to slices
andrewrk Jun 13, 2019
57347aa
fix atomic builtin functions
andrewrk Jun 14, 2019
eaf74f4
fix bitcast packed struct to integer and back
andrewrk Jun 14, 2019
fdaca1b
fix a couple more test regressions
andrewrk Jun 14, 2019
2ba29a1
fix peer result location with error code and payload
andrewrk Jun 14, 2019
7c074b8
fix peer result locs with switch
andrewrk Jun 14, 2019
acf16b5
uncomment more passing tests
andrewrk Jun 14, 2019
60025a3
Merge remote-tracking branch 'origin/master' into copy-elision-3
andrewrk Jun 15, 2019
6bf193a
better result location semantics with optionals and return locations
andrewrk Jun 15, 2019
9564c05
better result location handling of inline loops
andrewrk Jun 15, 2019
b025193
inferred comptime values rather than elided scopes
andrewrk Jun 17, 2019
74250e4
inferred comptime union inits
andrewrk Jun 17, 2019
0568000
fix function calls
andrewrk Jun 17, 2019
4e182c7
inferred comptime array inits
andrewrk Jun 17, 2019
e5a0414
misc fixes
andrewrk Jun 18, 2019
fdc6e0a
fix zero length array literal casted to slice
andrewrk Jun 18, 2019
077f9df
more miscellaneous fixes
andrewrk Jun 18, 2019
f90d17c
fix bitcast
andrewrk Jun 18, 2019
77e0c53
fix problem with inferred error set return result
andrewrk Jun 18, 2019
e27da17
back to many behavioral tests passing
andrewrk Jun 18, 2019
79671ef
fix inline loop behavior with variable result loc
andrewrk Jun 18, 2019
b588a80
fix comptime modification of const struct field
andrewrk Jun 19, 2019
e36680d
fix detection of unable to evaluate constant expression
andrewrk Jun 19, 2019
974db23
fix extraneous nested union field instruction
andrewrk Jun 19, 2019
9693122
fix comptime test error for empty error set
andrewrk Jun 19, 2019
c7dc03f
fix `try` not setting error code on result location
andrewrk Jun 19, 2019
4ffab5b
fix optional pointer to size zero struct
andrewrk Jun 19, 2019
04c25ef
Merge remote-tracking branch 'origin/master' into copy-elision-3
andrewrk Jun 19, 2019
78eeb6e
fix double getelementptr of runtime global
andrewrk Jun 20, 2019
6217b40
fix labeled break inside comptime if inside runtime if
andrewrk Jun 20, 2019
3c541d7
fix peer result loc fn call with comptime condition
andrewrk Jun 20, 2019
057b105
one more test passing
andrewrk Jun 20, 2019
237233b
fix coroutines
andrewrk Jun 20, 2019
0498bd4
fix loops with multiple break statements
andrewrk Jun 21, 2019
708f153
BRANCH_TODO file moved to the pull request comments
andrewrk Jun 21, 2019
4f21dc8
fix regression with zero sized array
andrewrk Jun 21, 2019
4299cd4
blocks have result location semantics
andrewrk Jun 21, 2019
48ccf42
fix nested orelse and nested catch
andrewrk Jun 21, 2019
142e77a
fix extern functions returning byval structs
andrewrk Jun 21, 2019
5441f77
fix implicit cast bitcast result to error union by returning
andrewrk Jun 21, 2019
ff6d563
fix implicit cast to optional to error union to return result loc
andrewrk Jun 21, 2019
727af30
fix return result loc and then switch with range...
andrewrk Jun 21, 2019
b5f9033
uncomment passing std lib tests
andrewrk Jun 21, 2019
726674b
fix ArenaAllocator
andrewrk Jun 22, 2019
65997f8
Merge remote-tracking branch 'origin/master' into copy-elision-3
andrewrk Jun 22, 2019
3c4b255
fix implicit cast fn call result to optional in field result
andrewrk Jun 22, 2019
86f362c
elide redundant safety check when switching on tagged unions
andrewrk Jun 22, 2019
2b1695b
fix std.json regression
andrewrk Jun 22, 2019
7e303fa
fix another crash
andrewrk Jun 22, 2019
3856831
fix some legacy coroutine stuff
andrewrk Jun 23, 2019
5e58aa4
uncomment passing std lib tests
andrewrk Jun 23, 2019
036cc48
Merge remote-tracking branch 'origin/master' into copy-elision-3
andrewrk Jun 23, 2019
020d5b5
compile error tests only for debug mode
andrewrk Jun 23, 2019
3021e5c
align (vector -> array) store to result location
mikdusan Jun 24, 2019
c61e0a0
fix union init with void payload
andrewrk Jun 25, 2019
cb55803
fix implicit cast vector to array
andrewrk Jun 25, 2019
da68aec
fix infinite loop when error in peer resolution
andrewrk Jun 25, 2019
0a77325
fix several compile error test regressions
andrewrk Jun 25, 2019
fd4c5f5
all compile error tests passing
andrewrk Jun 25, 2019
b4e40cb
fix peer type resolution with null
andrewrk Jun 26, 2019
ff737cc
fix peer type resolution: unreachable, error set, unreachable
andrewrk Jun 26, 2019
32c6f64
disable building self hosted compiler in test suite
andrewrk Jun 26, 2019
33f996b
all tests passing on linux
andrewrk Jun 26, 2019
5cd4753
add missing error code for DeleteFileW
andrewrk Jun 26, 2019
3085d29
Merge remote-tracking branch 'origin/master' into copy-elision-3
andrewrk Jun 26, 2019
517bdea
fix incorrectly omitting variable declarations
andrewrk Jun 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6734,6 +6734,7 @@ add_custom_command(
"-Doutput-dir=${CMAKE_BINARY_DIR}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
DEPENDS
zig0
"${CMAKE_SOURCE_DIR}/src-self-hosted/dep_tokenizer.zig"
"${CMAKE_SOURCE_DIR}/src-self-hosted/stage1.zig"
"${CMAKE_SOURCE_DIR}/src-self-hosted/translate_c.zig"
Expand Down
3 changes: 2 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ pub fn build(b: *Builder) !void {
const skip_non_native = b.option(bool, "skip-non-native", "Main test suite skips non-native builds") orelse false;
const skip_self_hosted = b.option(bool, "skip-self-hosted", "Main test suite skips building self hosted compiler") orelse false;
if (!skip_self_hosted) {
test_step.dependOn(&exe.step);
// TODO re-enable this after https://github.com/ziglang/zig/issues/2377
//test_step.dependOn(&exe.step);
}
const verbose_link_exe = b.option(bool, "verbose-link", "Print link command for self hosted compiler") orelse false;
exe.setVerboseLink(verbose_link_exe);
Expand Down
2 changes: 1 addition & 1 deletion doc/langref.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -5096,7 +5096,7 @@ fn gimmeTheBiggerInteger(a: u64, b: u64) u64 {
<p>
For example, if we were to introduce another function to the above snippet:
</p>
{#code_begin|test_err|values of type 'type' must be comptime known#}
{#code_begin|test_err|cannot store runtime value in type 'type'#}
fn max(comptime T: type, a: T, b: T) T {
return if (a > b) a else b;
}
Expand Down
Loading