Andrew Kelley
461382ae94
no-copy semantics for function call init var and literal
```zig
export fn entry() void {
var x = foo();
}
const Foo = struct {
x: i32,
};
fn foo() Foo {
return Foo{
.x = 1234,
};
}
```
```llvm
define void @entry() #2 !dbg !35 {
Entry:
%x = alloca %Foo, align 4
call fastcc void @foo(%Foo* sret %x), !dbg !45
call void @llvm.dbg.declare(metadata %Foo* %x, metadata !39, metadata !DIExpression()), !dbg !46
ret void, !dbg !47
}
define internal fastcc void @foo(%Foo* nonnull sret) unnamed_addr #2 !dbg !48 {
Entry:
%1 = bitcast %Foo* %0 to i8*, !dbg !52
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%Foo* @0 to i8*), i64 4, i1 false), !dbg !52
ret void, !dbg !52
}
```
2019-05-31 01:08:16 -04:00
..
2019-05-30 23:16:11 -04:00
2019-05-30 15:46:11 -04:00
2019-05-30 15:46:11 -04:00
2019-04-25 00:06:54 -04:00
2019-04-25 00:06:54 -04:00
2019-04-04 22:07:15 -04:00
2019-04-04 22:07:15 -04:00
2019-04-26 14:24:35 -04:00
2018-07-07 00:25:32 -04:00
2018-09-05 23:23:11 -04:00
2018-09-11 17:29:18 -04:00
2018-01-11 21:02:30 -05:00
2019-04-17 15:58:20 -04:00
2019-05-09 20:11:56 -04:00
2019-05-09 12:48:38 -04:00
2019-05-29 14:39:13 -04:00
2019-03-11 10:26:08 -04:00
2019-05-30 23:16:11 -04:00
2019-05-29 16:55:02 -04:00
2019-04-16 19:12:20 -04:00
2019-04-16 19:12:20 -04:00
2019-03-12 18:09:40 -04:00
2017-12-04 19:22:34 +09:00
2016-09-19 11:54:01 -04:00
2019-05-15 21:50:56 -04:00
2019-04-25 00:06:54 -04:00
2016-12-01 21:08:12 -05:00
2019-05-30 23:16:11 -04:00
2019-05-19 15:53:32 -04:00
2019-05-31 01:08:16 -04:00
2019-04-13 16:55:59 -04:00
2019-05-15 21:50:56 -04:00
2019-04-27 16:17:07 -05:00
2019-05-29 16:55:02 -04:00
2019-04-17 15:58:20 -04:00
2019-05-29 18:18:18 -04:00
2019-05-20 23:14:49 +02:00
2019-04-24 23:34:19 -04:00
2019-03-23 13:46:50 -04:00
2019-03-22 16:08:19 -04:00
2019-05-29 19:09:58 -04:00
2019-02-28 10:11:32 -05:00
2017-07-08 17:59:10 -04:00
2017-07-08 17:59:10 -04:00
2017-09-14 01:46:47 -04:00
2019-05-27 20:59:19 -04:00
2019-05-29 16:55:02 -04:00
2019-05-29 19:09:58 -04:00
2019-05-29 19:09:58 -04:00
2019-05-16 12:55:45 -04:00
2019-04-25 00:06:57 -04:00
2019-05-27 19:47:10 -04:00
2019-05-29 14:39:13 -04:00
2019-04-17 15:58:20 -04:00
2019-04-17 15:58:20 -04:00
2018-09-18 00:13:17 -04:00
2018-10-27 11:35:01 -04:00
2018-07-23 00:35:53 -04:00
2019-02-28 09:27:07 -05:00
2019-02-28 09:27:07 -05:00
2019-02-28 09:27:07 -05:00
2019-05-16 12:55:45 -04:00
2019-05-16 12:55:45 -04:00
2019-05-20 17:04:00 +02:00
2019-02-28 09:19:18 -05:00