Auto-import std::core. Fix module assignment of declarations. Introspection improvements. Deref null error panics in safe mode. Support for LLVM 15

This commit is contained in:
Christoffer Lerno
2022-06-21 14:44:28 +02:00
committed by Christoffer Lerno
parent df41caabdd
commit b1d83e2ccd
519 changed files with 26866 additions and 638 deletions

View File

@@ -0,0 +1,29 @@
// #safe: yes
module foo;
fn void main()
{
int* x;
int y = *x;
}
/* #expect: foo.ll
define void @foo.main() #0 {
entry:
%x = alloca i32*, align 8
%y = alloca i32, align 4
store i32* null, i32** %x, align 8
%0 = load i32*, i32** %x, align 8
%checknull = icmp eq i32* %0, null
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)
br label %checkok
checkok: ; preds = %panic, %entry
%1 = load i32, i32* %0, align 8
store i32 %1, i32* %y, align 4
ret void
}