[svn r106] Turns out the last commit wasn't enough, now the D->LLVM process is even more split up.

Basically it tries to do the following in order: Resolve types, Declare symbols, Create constant initializers, Apply initializers, Generate functions bodies.
ClassInfo is now has the most useful(biased?) members working.
Probably other stuf...
This commit is contained in:
Tomas Lindquist Olsen
2007-11-18 06:52:57 +01:00
parent 1c4cfc21ac
commit c99938debf
28 changed files with 800 additions and 306 deletions

View File

@@ -1,5 +1,7 @@
module bug51;
const ubyte[3] arr1 = 0;
const ubyte[3] arr2 = [0];
const ubyte[3] arr3 = [0:1];
void main() {}
const ubyte[3] arr3 = [1:1];
void main()
{
}

View File

@@ -1,10 +1,28 @@
module classinfo1;
class C
class NoPtrs
{
}
class HasPtrs
{
void* p;
}
void main()
{
ClassInfo ci = C.classinfo;
{
ClassInfo ci = NoPtrs.classinfo;
char[] name = ci.name;
printf("%.*s\n", name.length, name.ptr);
assert(ci.name == "classinfo1.NoPtrs");
assert(ci.flags == 2);
}
{
ClassInfo ci = HasPtrs.classinfo;
char[] name = ci.name;
printf("%.*s\n", name.length, name.ptr);
assert(ci.name == "classinfo1.HasPtrs");
assert(ci.flags == 0);
}
}

View File

@@ -42,14 +42,14 @@ void function_pointers()
binfn_t binfn = &add_int;
assert(binfn(4,1045) == 1049);
assert(binop_int(binfn, 10,656) == 666);
binfn = get_binop_int('+');
assert(binop_int(binfn, 10,100) == 110);
binfn = get_binop_int('-');
assert(binop_int(binfn, 10,100) == -90);
{
auto ffn = &mul_float;
float ftmp = mul_float(2.5,5);