-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
copy elision - var decl init to aggregate fn call
```zig export fn entry() void { var y = foo(); } fn foo() Foo { return Foo.{ .x = 1, .y = 2, }; } ``` ```llvm define void @entry() #2 !dbg !41 { Entry: %y = alloca %Foo, align 4 call fastcc void @foo(%Foo* sret %y), !dbg !52 call void @llvm.dbg.declare(metadata %Foo* %y, metadata !45, metadata !DIExpression()), !dbg !53 ret void, !dbg !54 } define internal fastcc void @foo(%Foo* nonnull sret) unnamed_addr #2 !dbg !55 { Entry: %1 = bitcast %Foo* %0 to i8*, !dbg !60 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %1, i8* align 4 bitcast (%Foo* @0 to i8*), i64 8, i1 false), !dbg !60 ret void, !dbg !60 } ```
- Loading branch information
Showing
2 changed files
with
54 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters