Mercurial > projects > ldc
comparison dmd/expression.c @ 108:288fe1029e1f trunk
[svn r112] Fixed 'case 1,2,3:' style case statements.
Fixed a bunch of bugs with return/break/continue in loops.
Fixed support for the DMDFE hidden implicit return value variable. This can be needed for some foreach statements where the loop body is converted to a nested delegate, but also possibly returns from the function.
Added std.math to phobos.
Added AA runtime support code, done ground work for implementing AAs.
Several other bugfixes.
author | lindquist |
---|---|
date | Tue, 20 Nov 2007 05:29:20 +0100 |
parents | 70d6113eeb8c |
children | a7dfa0ed966c |
comparison
equal
deleted
inserted
replaced
107:3efbcc81ba45 | 108:288fe1029e1f |
---|---|
5868 } | 5868 } |
5869 else if (e1->op == TOKvar) | 5869 else if (e1->op == TOKvar) |
5870 { | 5870 { |
5871 VarExp *dve = (VarExp *)e1; | 5871 VarExp *dve = (VarExp *)e1; |
5872 FuncDeclaration *f = dve->var->isFuncDeclaration(); | 5872 FuncDeclaration *f = dve->var->isFuncDeclaration(); |
5873 VarDeclaration *v = dve->var->isVarDeclaration(); | |
5873 | 5874 |
5874 if (f && f->isNested()) | 5875 if (f && f->isNested()) |
5875 { Expression *e; | 5876 { Expression *e; |
5876 | 5877 |
5877 e = new DelegateExp(loc, e1, f); | 5878 e = new DelegateExp(loc, e1, f); |
5878 e = e->semantic(sc); | 5879 e = e->semantic(sc); |
5879 return e; | 5880 return e; |
5880 } | 5881 } |
5882 else if (v) | |
5883 { | |
5884 v->llvmNeedsStorage = true; | |
5885 } | |
5881 } | 5886 } |
5882 else if (e1->op == TOKarray) | 5887 else if (e1->op == TOKarray) |
5883 { | 5888 { |
5884 if (e1->type->toBasetype()->ty == Tbit) | 5889 if (e1->type->toBasetype()->ty == Tbit) |
5885 error("cannot take address of bit in array"); | 5890 error("cannot take address of bit in array"); |
7541 /************************* AddExp *****************************/ | 7546 /************************* AddExp *****************************/ |
7542 | 7547 |
7543 AddExp::AddExp(Loc loc, Expression *e1, Expression *e2) | 7548 AddExp::AddExp(Loc loc, Expression *e1, Expression *e2) |
7544 : BinExp(loc, TOKadd, sizeof(AddExp), e1, e2) | 7549 : BinExp(loc, TOKadd, sizeof(AddExp), e1, e2) |
7545 { | 7550 { |
7551 llvmFieldIndex = false; | |
7546 } | 7552 } |
7547 | 7553 |
7548 Expression *AddExp::semantic(Scope *sc) | 7554 Expression *AddExp::semantic(Scope *sc) |
7549 { Expression *e; | 7555 { Expression *e; |
7550 | 7556 |