mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-25 08:57:55 +00:00
Restart LLVM IR SSA generation
This is the third go and I'm going for it!
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
int main() {
|
||||
float a = 0.5;
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
define void @main() {
|
||||
entry:
|
||||
%0 = alloca i64, align 8
|
||||
store i64 zeroinitializer, i64* %0
|
||||
store i64 137, i64* %0
|
||||
%1 = load i64, i64* %0
|
||||
add i64 1, %1
|
||||
store i64 %2, i64* %0
|
||||
%3 = alloca float, align 4
|
||||
store float zeroinitializer, float* %3
|
||||
store float 0x3f8147ae00000000, float* %3
|
||||
%4 = load float, float* %3
|
||||
fadd float %4, 0x3f7d70a400000000
|
||||
store float %5, float* %3
|
||||
ret void
|
||||
}
|
||||
+8
-3
@@ -1,6 +1,11 @@
|
||||
type Vec2: struct { x, y: f32 }
|
||||
|
||||
|
||||
main :: proc() {
|
||||
// x : string;
|
||||
// x = "Hello";
|
||||
x : int;
|
||||
x = 137;
|
||||
x = 1 + x;
|
||||
|
||||
y : f32;
|
||||
y = 1.01;
|
||||
y = y + 0.99;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user