mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Optimize sret / byval. Fixes to types and failables.
This commit is contained in:
committed by
Christoffer Lerno
parent
dfe3128b16
commit
160659c4e3
@@ -24,11 +24,7 @@ fn void test(Bar b)
|
||||
|
||||
define void @foo_test(%Bar* byval(%Bar) align 8 %0) #0 {
|
||||
entry:
|
||||
%b = alloca %Bar, align 4
|
||||
%1 = bitcast %Bar* %b to i8*
|
||||
%2 = bitcast %Bar* %0 to i8*
|
||||
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %1, i8* align 8 %2, i32 8, i1 false)
|
||||
%3 = getelementptr inbounds %Bar, %Bar* %b, i32 0, i32 2
|
||||
%4 = getelementptr inbounds [0 x i32], [0 x i32]* %3, i64 0, i64 1
|
||||
%1 = getelementptr inbounds %Bar, %Bar* %0, i32 0, i32 2
|
||||
%2 = getelementptr inbounds [0 x i32], [0 x i32]* %1, i64 0, i64 1
|
||||
ret void
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
define Foo = int[0];
|
||||
define Foo = int[0]; // #error: An array may not have zero
|
||||
|
||||
struct Bar
|
||||
{
|
||||
Foo x; // #error: Zero length arrays are not valid members.
|
||||
Foo x;
|
||||
int b;
|
||||
}
|
||||
Reference in New Issue
Block a user