Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
1bf72c6
copy elision using the ir system
andrewrk Oct 18, 2018
3037be1
copy elision: test case: scalar variable declaration
andrewrk Oct 25, 2018
1dfca20
copy elision: test case: initialize scalar undefined
andrewrk Oct 25, 2018
dd320ee
copy elision: scalar variable decl with type inference
andrewrk Oct 26, 2018
29ce2b6
copy elision: handle alignment
andrewrk Oct 27, 2018
9a60a65
copy elision: initialization of variable to constant
andrewrk Oct 27, 2018
c7c3cfc
copy elision - var decl init to aggregate fn call
andrewrk Oct 27, 2018
c6dea5f
copy elision - fn returning result of other fn
andrewrk Oct 27, 2018
ca69d47
copy elision - var decl initializing to aggregate runtime var
andrewrk Oct 29, 2018
dcf1a57
copy elision: implicit cast optional wrap aggregate
andrewrk Oct 29, 2018
7f3c7f3
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Oct 29, 2018
ff943d9
copy elision: implicit cast optional wrap when payload is integer
andrewrk Oct 29, 2018
d0dcfea
copy elision: if bool expression with aggregate
andrewrk Oct 30, 2018
7608505
copy elision: implicit cast payload to error union
andrewrk Oct 30, 2018
5106eac
copy elision: implicit cast error set to error union
andrewrk Oct 30, 2018
e1dfb5f
copy elision: double implicit cast
andrewrk Oct 30, 2018
5ee4e5a
copy elision: runtime struct init
andrewrk Oct 30, 2018
952da3c
copy elision: catch unreachable with identifier expr
andrewrk Oct 30, 2018
d77b368
copy elision: catch with identifier expression
andrewrk Oct 30, 2018
94abb0d
copy elision: if-bool with scalar types
andrewrk Oct 30, 2018
1bda970
copy elision: if-optional with aggregate
andrewrk Oct 30, 2018
88427ae
copy elision: if-err with aggregate
andrewrk Oct 30, 2018
7d6c967
copy elision: implicit cast error set to error union runtime
andrewrk Oct 30, 2018
58a3d99
copy elision: if-err with scalar types
andrewrk Oct 30, 2018
a694363
copy elision: returning scalar from function
andrewrk Oct 30, 2018
00a5b72
copy elision: while-optional with aggregate
andrewrk Oct 30, 2018
167c37e
copy elision: while-bool with aggregate
andrewrk Oct 31, 2018
6af39bc
copy elision: while-err with aggregates
andrewrk Oct 31, 2018
25306e3
result location mechanism gains ability to infer comptime
andrewrk Nov 2, 2018
e36d737
copy elision: fix var decls and return result instructions
andrewrk Nov 3, 2018
7d4d8b1
copy elision: implicit cast error set to error union
andrewrk Nov 5, 2018
9e9ec3b
copy elision: implicit optional wrap
andrewrk Nov 5, 2018
7b86ff5
const expr supports parent pointers for error union payloads
andrewrk Nov 6, 2018
c136bff
copy elision: handle store ptr with runtime value better
andrewrk Nov 6, 2018
c17c46c
copy elision: implicit cast fn call to error union
andrewrk Nov 6, 2018
b222222
copy elision: fix unwrap maybe and while
andrewrk Nov 7, 2018
84f48a6
copy elision: for with aggregates
andrewrk Nov 7, 2018
20f2439
copy elision: runtime and comptime array initialization
andrewrk Nov 8, 2018
2c65a5a
copy elision: runtime and comptime union init
andrewrk Nov 8, 2018
cf9153e
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Nov 8, 2018
65501f0
copy elision: handle inferred comptime const with if
andrewrk Nov 9, 2018
40d6ca4
copy elision: switch with aggregate
andrewrk Nov 9, 2018
d5df75f
copy elision: fix invalid "unused expression" error
andrewrk Nov 9, 2018
a2eb0fe
copy elision: catch with error union function call
andrewrk Nov 9, 2018
f5c7654
copy elision: implicit `*[N]T` to `[]T`
andrewrk Nov 11, 2018
9d1bb34
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Nov 13, 2018
15a3f26
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Nov 14, 2018
aa1b99d
copy elision: multiple implicit cast of scalar
andrewrk Nov 15, 2018
80fb0f6
copy elision: fix a couple regressions
andrewrk Nov 15, 2018
99a2e8b
copy elision: null result loc for addr-of
andrewrk Nov 15, 2018
e678e64
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Nov 16, 2018
b81abfa
copy elision: fix comptime fn call regression
andrewrk Nov 16, 2018
5f20636
copy elision: fix regression: function call with 1 arg
andrewrk Nov 16, 2018
c30908d
copy elision: slice syntax with no result loc
andrewrk Nov 16, 2018
d534f38
copy elision: remove LoadResult and StoreResult instructions
andrewrk Nov 19, 2018
0e41e90
copy elision: remove all uses of ir_lval_wrap
andrewrk Nov 19, 2018
6299526
copy elision: match ir_gen_result with ensure_result_loc
andrewrk Nov 19, 2018
2cd4351
copy elision: @bitCast with runtime value
andrewrk Nov 21, 2018
522780e
copy elision: @bitCast with comptime value
andrewrk Nov 21, 2018
34f3d74
copy elision: fix simple int cast
andrewrk Nov 23, 2018
b190b8f
copy elision: fix @typeName
andrewrk Nov 23, 2018
094d3f2
copy elision: fix slicing
andrewrk Nov 23, 2018
e15e310
copy elision: better slice codegen
andrewrk Nov 23, 2018
baedbf5
copy elision: better slice analysis
andrewrk Nov 23, 2018
2eda967
copy elision: fix `try` when no result location
andrewrk Nov 23, 2018
8389036
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Nov 23, 2018
c53a557
copy elision: fix for loop
andrewrk Nov 23, 2018
7ab8983
for loops: use i < N rather than i != N
andrewrk Nov 23, 2018
8236c5a
copy elision: fix result optional payload for pointer types
andrewrk Nov 24, 2018
82c8617
copy elision: fix generic functions
andrewrk Nov 24, 2018
24e11e5
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Nov 24, 2018
05a325e
copy elision: fix switch when no result location for target
andrewrk Nov 25, 2018
252938c
copy elision: comptime slice
andrewrk Nov 25, 2018
be17a1e
copy elision: orelse
andrewrk Nov 26, 2018
ca440b3
copy elision: @cmpxchg
andrewrk Nov 28, 2018
f4b27a3
copy elision: function call with error union return
andrewrk Nov 28, 2018
eebfb2e
copy elision: handle direct assignment of anyerror!void
andrewrk Nov 28, 2018
edd48a5
copy elision: introduce LValErrorUnionVal, LValErrorUnionPtr
andrewrk Nov 29, 2018
696fcd5
copy elision: return pointers for error union functions
andrewrk Nov 29, 2018
1ad72aa
copy elision: function with optional pointer return type
andrewrk Nov 30, 2018
aff8677
copy elision: return a var which casts to error union
andrewrk Nov 30, 2018
92c976d
copy elision: return T from fn with return type E!T
andrewrk Nov 30, 2018
5fdcf68
copy elision: fix switch statements on bare number
andrewrk Nov 30, 2018
af2e55e
copy elision: fix try on an error union fn call
andrewrk Dec 5, 2018
38b560f
copy elision: const slice
andrewrk Dec 6, 2018
581ab45
copy elision: implicit return void in an error union fn
andrewrk Dec 6, 2018
58aed42
copy elision: fix returning explicit error set as error union
andrewrk Dec 6, 2018
64e8677
copy elision: return fn call with error set return value
andrewrk Dec 11, 2018
34687ca
copy elision: hello world is working
andrewrk Dec 11, 2018
5579e9a
fix assertion regarding unresolved inferred error set
andrewrk Dec 11, 2018
0ff9c9d
copy elision: misc fixes
andrewrk Dec 15, 2018
2b39363
copy elision: @sliceToBytes
andrewrk Dec 18, 2018
8692cc9
copy elision: @bytesToSlice with identifier parameter
andrewrk Dec 18, 2018
29b90ac
copy elision: @bytesToSlice with fn call
andrewrk Dec 18, 2018
95473b9
copy elision: @bytesToSlice with consts
andrewrk Dec 18, 2018
66f5643
@bytesToSlice: better compile error message
andrewrk Dec 18, 2018
c86736f
copy elision: fix @sliceToBytes not updating the length
andrewrk Dec 19, 2018
7c7cd25
copy elision: fn call creates result loc for args when necessary
andrewrk Dec 19, 2018
f59875f
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Dec 19, 2018
b679755
copy elision: array to slice implicit cast
andrewrk Dec 19, 2018
4d4fcb1
copy elision: fix cast array to slice mixing const,var
andrewrk Dec 19, 2018
4998ca9
copy elision: fix while loop with break
andrewrk Dec 19, 2018
4e9f73d
cherry pick 8768816d69dd from master
andrewrk Dec 19, 2018
073f627
copy elision: fix some crashes
andrewrk Dec 20, 2018
928b84f
copy elision: fix generic fn call with 1 arg
andrewrk Dec 21, 2018
abe5fe8
copy elision: actually we need a result loc for first arg
andrewrk Dec 21, 2018
8702493
fix switch expression incorrectly giving unreachable code error
andrewrk Dec 21, 2018
d839cf9
compiler_rt compiles again
andrewrk Dec 21, 2018
250c132
copy-elision: fix comptime blocks
andrewrk Dec 23, 2018
d2e91d0
copy elision: catch function call
andrewrk Dec 23, 2018
cc2a1b2
copy elision: fix ptr of array to slice as a param
andrewrk Dec 23, 2018
ba80dd5
copy elision: fix ref instruction having no result loc
andrewrk Dec 23, 2018
9839b3a
copy elision: fix inline for
andrewrk Dec 24, 2018
bf41ccc
copy elision: move the first behavior test to copy elision
andrewrk Dec 24, 2018
d0bd1a6
copy elision: move passing tests
andrewrk Dec 24, 2018
36506e6
copy elision: fix fn call as fn parameter
andrewrk Dec 24, 2018
a460153
copy elision: move passing tests
andrewrk Dec 24, 2018
09e5fbb
copy elision: fix mutability of result slice of @sliceToBytes
andrewrk Dec 24, 2018
e3f17de
copy elision: move passing tests
andrewrk Dec 24, 2018
750c2dd
copy elision: move passing tests
andrewrk Dec 25, 2018
d80e5d7
copy elision: move passing tests
andrewrk Dec 25, 2018
73f96be
copy elision: fix runtime array to slice
andrewrk Dec 27, 2018
2cf1857
copy elision: fix cmpxchg with pointer
andrewrk Dec 27, 2018
c0df4bf
copy elision: @bitCast between signed/unsigned int
andrewrk Dec 27, 2018
5be3d63
copy elision: comptime @bitCast extern enum to int
andrewrk Dec 27, 2018
c1673a4
copy elision: move passing tests
andrewrk Dec 27, 2018
a5d83d0
copy elision: fix implicit cast
andrewrk Dec 27, 2018
31f79c4
copy elision: comptime const array init
andrewrk Dec 29, 2018
fb65abb
copy elision: fix comptime struct init
andrewrk Dec 29, 2018
8f2931c
copy elision: fn call returning scalar optional in equality expression
andrewrk Dec 29, 2018
22332d7
copy elision: fix slicing result of fn call
andrewrk Dec 30, 2018
a1fad2b
copy elision: move passing tests
andrewrk Dec 30, 2018
1941975
copy elision: fix returning implicit void from a
andrewrk Dec 30, 2018
49cd82a
copy elision: fix returning null literal from fn
andrewrk Dec 30, 2018
ce6862f
copy elision: fix while with error union condition
andrewrk Dec 30, 2018
d3c8bbd
copy elision: fix returning payload from optional function
andrewrk Dec 30, 2018
7a026c7
copy elision: move passing tests
andrewrk Dec 30, 2018
f99ff48
copy elision: move passing tests
andrewrk Dec 30, 2018
8749d05
copy elision: optional pointer to size zero struct
andrewrk Dec 30, 2018
7386fa3
copy elision: fix comptime casting null to ?T
andrewrk Dec 31, 2018
c929d36
copy elision: move passing tests
andrewrk Dec 31, 2018
81c3bbd
add error for trying to store runtime value in comptime type
andrewrk Jan 2, 2019
c54b0d5
copy elision: while expressions support no-copy error unions / optionals
andrewrk Jan 2, 2019
b168b81
copy elision: for loops support no-copy error unions / optionals
andrewrk Jan 2, 2019
7cbd7ab
copy elision: switch support no-copy error unions / optionals
andrewrk Jan 2, 2019
937a60f
copy elision: move passing tests
andrewrk Jan 2, 2019
d4f48e5
test skeletons in place. change assert to assertOrPanic
andrewrk Jan 2, 2019
56a9b3b
copy elision: fix comptime union init
andrewrk Jan 2, 2019
940194d
copy elision: fix union assignment
andrewrk Jan 2, 2019
01bf53b
copy elision: move passing tests
andrewrk Jan 2, 2019
3faae74
copy elision: fix switch prong implicit cast
andrewrk Jan 2, 2019
c357610
copy elision: move passing tests
andrewrk Jan 2, 2019
bbb2d78
copy elision: move passing tests
andrewrk Jan 2, 2019
64ae78f
allow writing null to pointer in runtime branch
andrewrk Jan 3, 2019
9e2de5c
copy elision: move passing tests
andrewrk Jan 3, 2019
7d57801
copy elision: move passing tests
andrewrk Jan 4, 2019
907563e
fix comptime @bitCast incorrectly changing a variable's type
andrewrk Jan 4, 2019
15dac3c
copy elision: fix void optional
andrewrk Jan 4, 2019
3205c75
copy elision: fix coroutines
andrewrk Jan 4, 2019
434f676
copy elision: workaround for FixedBufferAllocator
andrewrk Jan 4, 2019
ea6acef
copy elision: fix error binary operator
andrewrk Jan 7, 2019
a697b63
copy elision: fix comptime test error for empty error set
andrewrk Jan 7, 2019
ec1516c
copy elision: fix error union peer type resolution
andrewrk Jan 7, 2019
b49201a
copy elision: fix test: "error zero sized error
andrewrk Jan 7, 2019
b93ca17
copy elision: fix test: "error: Infer error set from literals"
andrewrk Jan 7, 2019
e383bba
copy elision: move passing tests
andrewrk Jan 7, 2019
725b6fa
better implementation of type_has_one_possible_value
andrewrk Jan 8, 2019
f164c59
copy elision: move passing tests
andrewrk Jan 8, 2019
0a8c211
copy elision: fix some error union return type stuff
andrewrk Jan 8, 2019
a3b8b5d
copy elision: fix test: "comptime modification of
andrewrk Jan 8, 2019
84931e4
copy elision: move passing tests
andrewrk Jan 8, 2019
80f7c85
copy elision: workaround for test case
andrewrk Jan 9, 2019
5cbc18a
copy elision: block results guarantee copy elision
andrewrk Jan 9, 2019
6495172
copy elision: fix nested optional/error unions inside each other
andrewrk Jan 14, 2019
407bac5
copy elision: fix orelse on constant value
andrewrk Jan 15, 2019
1e19a5a
copy elision: fix comptime optional fn call
andrewrk Jan 16, 2019
49efa09
copy elision: fix returning const optional/error unions
andrewrk Jan 17, 2019
28bd624
copy elision: fix comptime fn call when error union val is expected
andrewrk Jan 18, 2019
88ca0e2
Merge remote-tracking branch 'origin/master' into copy-elision-2
andrewrk Jan 20, 2019
ae3f6f6
copy elision: move passing tests
andrewrk Jan 20, 2019
b0d2680
copy elision: fix test "@bytesToSlice keeps pointer alignment"
andrewrk Jan 20, 2019
cf5e54a
copy elision: fix test "implicit ptr to *c_void"
andrewrk Jan 20, 2019
5ed6d27
copy elision: move passing tests
andrewrk Jan 21, 2019
42b4e65
copy elision: fix test "mixing normal and error defers"
andrewrk Jan 21, 2019
32c3caa
copy elision: fix test "optional types"
andrewrk Jan 21, 2019
9b02ce7
copy elision: fix test "struct contains slice of itself"
andrewrk Jan 21, 2019
8e2b07e
copy elision: fix test "coroutine await struct"
andrewrk Jan 21, 2019
a6cc7f8
copy elision: fix test "async fn with inferred error set"
andrewrk Jan 21, 2019
80fc424
workaround for not handling return value in coroutines
andrewrk Jan 21, 2019
2d3a397
copy elision: fix address of unwrap optional
andrewrk Jan 21, 2019
5f2f5ac
copy elision: fix nested error union function call in optional unwrap
andrewrk Jan 22, 2019
9312d50
copy elision: fix widen cast integer payload of...
andrewrk Jan 22, 2019
9128075
fix return function call to error set from error union function
andrewrk Jan 22, 2019
3f569eb
std: workaround for copy elision limitation
andrewrk Jan 22, 2019
98d87f0
copy elision: fix passing an optional integer as a parameter
andrewrk Jan 22, 2019
cfa1ef8
copy elision: fix array literal as argument to function
andrewrk Jan 22, 2019
0d16621
copy elision: fix double nested array to...
andrewrk Jan 23, 2019
1f7e3c9
copy elision: fix unwrap function call with optional...
andrewrk Jan 24, 2019
d7a5d09
copy elision: assertOrPanic in behavior tests
andrewrk Jan 30, 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
11 changes: 6 additions & 5 deletions doc/langref.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -5905,13 +5905,13 @@ fn add(a: i32, b: i32) i32 { return a + b; }
This function is a low level intrinsic with no safety mechanisms. Most code
should not use this function, instead using something like this:
</p>
<pre>{#syntax#}for (source[0...byte_count]) |b, i| dest[i] = b;{#endsyntax#}</pre>
<pre>{#syntax#}for (source[0..byte_count]) |b, i| dest[i] = b;{#endsyntax#}</pre>
<p>
The optimizer is intelligent enough to turn the above snippet into a memcpy.
</p>
<p>There is also a standard library function for this:</p>
<pre>{#syntax#}const mem = @import("std").mem;
mem.copy(u8, dest[0...byte_count], source[0...byte_count]);{#endsyntax#}</pre>
mem.copy(u8, dest[0..byte_count], source[0..byte_count]);{#endsyntax#}</pre>
{#header_close#}

{#header_open|@memset#}
Expand All @@ -5923,7 +5923,7 @@ mem.copy(u8, dest[0...byte_count], source[0...byte_count]);{#endsyntax#}</pre>
This function is a low level intrinsic with no safety mechanisms. Most
code should not use this function, instead using something like this:
</p>
<pre>{#syntax#}for (dest[0...byte_count]) |*b| b.* = c;{#endsyntax#}</pre>
<pre>{#syntax#}for (dest[0..byte_count]) |*b| b.* = c;{#endsyntax#}</pre>
<p>
The optimizer is intelligent enough to turn the above snippet into a memset.
</p>
Expand Down Expand Up @@ -6592,9 +6592,10 @@ pub const TypeInfo = union(TypeId) {
{#header_close#}

{#header_open|@typeName#}
<pre>{#syntax#}@typeName(T: type) []u8{#endsyntax#}</pre>
<pre>{#syntax#}@typeName(T: type) [N]u8{#endsyntax#}</pre>
<p>
This function returns the string representation of a type.
This function returns the string representation of a type, as
an array. It is equivalent to a string literal of the type name.
</p>

{#header_close#}
Expand Down
Loading