view tests/code/if_4.d @ 24:2d28b21faad6 new_gen

New codegen! Rewritten codegen to use the llvm bindings Everything except struct are back to normal, and there a a few additions. 1. Correct code in more cases, return at the end of a while/if wont generate a "ret" followed by a "br". 2. Better scope, "int x = x" now illegal 3. Probably more
author Anders Halager <halager@gmail.com>
date Sat, 19 Apr 2008 18:29:42 +0200
parents
children
line wrap: on
line source

int main()
{
    int x = 0;
    int y = 1;
    if (x)
        return 1;
    else if (y == 2)
        return 1;
    else
        y = 0;
    return y;
}