Massive Refactor and If statements

This commit is contained in:
gingerBill
2016-08-02 01:08:36 +01:00
parent e5665a190d
commit bf3283c889
12 changed files with 1229 additions and 1102 deletions
+8 -3
View File
@@ -1,6 +1,11 @@
int main() {
float a = 0.5;
float b = 1.5;
int c = a < b;
int x = 15;
int y = 4;
x = x & (~y);
if (x > 0) {
x = 123;
} else {
x = 321;
}
return 0;
}
+13
View File
@@ -1,4 +1,17 @@
define void @main() {
entry:
%0 = alloca i64, align 8 ; x
store i64 zeroinitializer, i64* %0
store i64 15, i64* %0
%1 = load i64, i64* %0
%2 = icmp sgt i64 %1, 0
br i1 %2, label %if-then, label %if-else
if-then:
store i64 123, i64* %0
br label %if-end
if-else:
store i64 321, i64* %0
br label %if-end
if-end:
ret void
}
+6
View File
@@ -1,2 +1,8 @@
main :: proc() {
x : int = 15;
if x > 0 {
x = 123;
} else {
x = 321;
}
}