Added CT_SWITCH parsing in top level. Nil changed to null. Parsing more in line with grammar. Parse type as expressions. Zero init by default for locals. Corrected bool/fp conversion. Add memcpy pass to fix issue with value load/stores.

This commit is contained in:
Christoffer Lerno
2020-09-05 16:18:09 +02:00
committed by Christoffer Lerno
parent fb937156fe
commit 77ccfc1f7c
43 changed files with 863 additions and 415 deletions

View File

@@ -43,7 +43,7 @@ func void tester()
p.bb.b = 2;
p.b = 3;
p.c = 4;
p.p = nil;
p.p = null;
p.d = 5;
p.e = 6;
p.uu.d = 7;

View File

@@ -58,7 +58,7 @@ func void test_nonstatic_stuct_func1()
func void test_nonstatic_stuct_func2()
{
int a = Foo.func2.sizeof;
int b = Foo.func2(nil, 2);
int b = Foo.func2(null, 2);
}
*/

View File

@@ -18,10 +18,7 @@ func void test1()
@Point = linkonce_odr constant i8 1
entry:
%p = alloca %test.Point
%0 = getelementptr inbounds %test.Point, %test.Point* %p, i32 0, i32 0
store i32 5, i32* %0
%1 = getelementptr inbounds %test.Point, %test.Point* %p, i32 0, i32 1
store i32 6, i32* %1
%2 = load %test.Point, %test.Point* %p
%p = alloca %test.Point
%0 = load %test.Point, %test.Point* @0
store %test.Point %0, %test.Point* %p