Mercurial > projects > ldc
comparison dmd/expression.c @ 1626:8fa4ab3dcc88
Merge DMD r320: refactor
---
dmd/expression.c | 7 +++----
dmd/expression.h | 2 +-
dmd/mtype.c | 34 ++++++++--------------------------
3 files changed, 12 insertions(+), 31 deletions(-)
author | Leandro Lucarella <llucax@gmail.com> |
---|---|
date | Wed, 06 Jan 2010 15:18:23 -0300 |
parents | fb2e6707ad17 |
children | e83f0778c260 |
comparison
equal
deleted
inserted
replaced
1625:79f64d5fee9e | 1626:8fa4ab3dcc88 |
---|---|
866 tb = arg->type->toBasetype(); | 866 tb = arg->type->toBasetype(); |
867 if (tb->ty == Tsarray) | 867 if (tb->ty == Tsarray) |
868 { TypeSArray *ts = (TypeSArray *)tb; | 868 { TypeSArray *ts = (TypeSArray *)tb; |
869 Type *ta = ts->next->arrayOf(); | 869 Type *ta = ts->next->arrayOf(); |
870 if (ts->size(arg->loc) == 0) | 870 if (ts->size(arg->loc) == 0) |
871 { arg = new NullExp(arg->loc); | 871 arg = new NullExp(arg->loc, ta); |
872 arg->type = ta; | |
873 } | |
874 else | 872 else |
875 arg = arg->castTo(sc, ta); | 873 arg = arg->castTo(sc, ta); |
876 } | 874 } |
877 #if DMDV2 | 875 #if DMDV2 |
878 if (tb->ty == Tstruct) | 876 if (tb->ty == Tstruct) |
2585 } | 2583 } |
2586 | 2584 |
2587 | 2585 |
2588 /******************************** NullExp **************************/ | 2586 /******************************** NullExp **************************/ |
2589 | 2587 |
2590 NullExp::NullExp(Loc loc) | 2588 NullExp::NullExp(Loc loc, Type *type) |
2591 : Expression(loc, TOKnull, sizeof(NullExp)) | 2589 : Expression(loc, TOKnull, sizeof(NullExp)) |
2592 { | 2590 { |
2593 committed = 0; | 2591 committed = 0; |
2592 this->type = type; | |
2594 } | 2593 } |
2595 | 2594 |
2596 Expression *NullExp::semantic(Scope *sc) | 2595 Expression *NullExp::semantic(Scope *sc) |
2597 { | 2596 { |
2598 #if LOGSEMANTIC | 2597 #if LOGSEMANTIC |