Update panic function and early work on tests. Optimize ABI lowering.

This commit is contained in:
Christoffer Lerno
2022-11-02 23:49:51 +01:00
committed by Christoffer Lerno
parent 70f6ad1b27
commit 73619817ba
105 changed files with 10369 additions and 13313 deletions

View File

@@ -1,4 +1,5 @@
// #safe: yes
// #target: macos-x64
module foo;
fn void main()
@@ -19,11 +20,12 @@ entry:
br i1 %checknull, label %panic, label %checkok
panic: ; preds = %entry
call void @std_core_builtin_panic(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.zstr, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.zstr.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.zstr.2, i64 0, i64 0), i32 6)
%1 = load void (i8*, i64, i8*, i64, i8*, i64, i32)*, void (i8*, i64, i8*, i64, i8*, i64, i32)** @std_core_builtin_panic, align 8
call void %1(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.panic_msg, i64 0, i64 0), i64 27, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.file, i64 0, i64 0), i64 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.func, i64 0, i64 0), i64 4, i32 6)
br label %checkok
checkok: ; preds = %panic, %entry
%1 = load i32, i32* %0, align 8
store i32 %1, i32* %y, align 4
%2 = load i32, i32* %0, align 8
store i32 %2, i32* %y, align 4
ret void
}