comparison dmd/mtype.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 1d48eced441f
children e83f0778c260
comparison
equal deleted inserted replaced
1625:79f64d5fee9e 1626:8fa4ab3dcc88
2237 Expression *TypeDArray::defaultInit(Loc loc) 2237 Expression *TypeDArray::defaultInit(Loc loc)
2238 { 2238 {
2239 #if LOGDEFAULTINIT 2239 #if LOGDEFAULTINIT
2240 printf("TypeDArray::defaultInit() '%s'\n", toChars()); 2240 printf("TypeDArray::defaultInit() '%s'\n", toChars());
2241 #endif 2241 #endif
2242 Expression *e; 2242 return new NullExp(loc, this);
2243 e = new NullExp(loc);
2244 e->type = this;
2245 return e;
2246 } 2243 }
2247 2244
2248 int TypeDArray::isZeroInit(Loc loc) 2245 int TypeDArray::isZeroInit(Loc loc)
2249 { 2246 {
2250 return 1; 2247 return 1;
2510 Expression *TypeAArray::defaultInit(Loc loc) 2507 Expression *TypeAArray::defaultInit(Loc loc)
2511 { 2508 {
2512 #if LOGDEFAULTINIT 2509 #if LOGDEFAULTINIT
2513 printf("TypeAArray::defaultInit() '%s'\n", toChars()); 2510 printf("TypeAArray::defaultInit() '%s'\n", toChars());
2514 #endif 2511 #endif
2515 Expression *e; 2512 return new NullExp(loc, this);
2516 e = new NullExp(loc);
2517 e->type = this;
2518 return e;
2519 } 2513 }
2520 2514
2521 int TypeAArray::isZeroInit(Loc loc) 2515 int TypeAArray::isZeroInit(Loc loc)
2522 { 2516 {
2523 return TRUE; 2517 return TRUE;
2626 Expression *TypePointer::defaultInit(Loc loc) 2620 Expression *TypePointer::defaultInit(Loc loc)
2627 { 2621 {
2628 #if LOGDEFAULTINIT 2622 #if LOGDEFAULTINIT
2629 printf("TypePointer::defaultInit() '%s'\n", toChars()); 2623 printf("TypePointer::defaultInit() '%s'\n", toChars());
2630 #endif 2624 #endif
2631 Expression *e; 2625 return new NullExp(loc, this);
2632 e = new NullExp(loc);
2633 e->type = this;
2634 return e;
2635 } 2626 }
2636 2627
2637 int TypePointer::isZeroInit(Loc loc) 2628 int TypePointer::isZeroInit(Loc loc)
2638 { 2629 {
2639 return 1; 2630 return 1;
2693 Expression *TypeReference::defaultInit(Loc loc) 2684 Expression *TypeReference::defaultInit(Loc loc)
2694 { 2685 {
2695 #if LOGDEFAULTINIT 2686 #if LOGDEFAULTINIT
2696 printf("TypeReference::defaultInit() '%s'\n", toChars()); 2687 printf("TypeReference::defaultInit() '%s'\n", toChars());
2697 #endif 2688 #endif
2698 Expression *e = new NullExp(loc); 2689 return new NullExp(loc, this);
2699 e->type = this;
2700 return e;
2701 } 2690 }
2702 2691
2703 int TypeReference::isZeroInit(Loc loc) 2692 int TypeReference::isZeroInit(Loc loc)
2704 { 2693 {
2705 return 1; 2694 return 1;
3286 Expression *TypeDelegate::defaultInit(Loc loc) 3275 Expression *TypeDelegate::defaultInit(Loc loc)
3287 { 3276 {
3288 #if LOGDEFAULTINIT 3277 #if LOGDEFAULTINIT
3289 printf("TypeDelegate::defaultInit() '%s'\n", toChars()); 3278 printf("TypeDelegate::defaultInit() '%s'\n", toChars());
3290 #endif 3279 #endif
3291 Expression *e; 3280 return new NullExp(loc, this);
3292 e = new NullExp(loc);
3293 e->type = this;
3294 return e;
3295 } 3281 }
3296 3282
3297 int TypeDelegate::isZeroInit(Loc loc) 3283 int TypeDelegate::isZeroInit(Loc loc)
3298 { 3284 {
3299 return 1; 3285 return 1;
4709 sym->size(0); // give error for forward references 4695 sym->size(0); // give error for forward references
4710 return sym->structalign; 4696 return sym->structalign;
4711 } 4697 }
4712 4698
4713 Expression *TypeStruct::defaultInit(Loc loc) 4699 Expression *TypeStruct::defaultInit(Loc loc)
4714 { Declaration *d; 4700 {
4715
4716 #if LOGDEFAULTINIT 4701 #if LOGDEFAULTINIT
4717 printf("TypeStruct::defaultInit() '%s'\n", toChars()); 4702 printf("TypeStruct::defaultInit() '%s'\n", toChars());
4718 #endif 4703 #endif
4719 d = new StaticStructInitDeclaration(sym->loc, sym); 4704 Declaration *d = new StaticStructInitDeclaration(sym->loc, sym);
4720 assert(d); 4705 assert(d);
4721 d->type = this; 4706 d->type = this;
4722 return new VarExp(sym->loc, d); 4707 return new VarExp(sym->loc, d);
4723 } 4708 }
4724 4709
5178 Expression *TypeClass::defaultInit(Loc loc) 5163 Expression *TypeClass::defaultInit(Loc loc)
5179 { 5164 {
5180 #if LOGDEFAULTINIT 5165 #if LOGDEFAULTINIT
5181 printf("TypeClass::defaultInit() '%s'\n", toChars()); 5166 printf("TypeClass::defaultInit() '%s'\n", toChars());
5182 #endif 5167 #endif
5183 Expression *e; 5168 return new NullExp(loc, this);
5184 e = new NullExp(loc);
5185 e->type = this;
5186 return e;
5187 } 5169 }
5188 5170
5189 int TypeClass::isZeroInit(Loc loc) 5171 int TypeClass::isZeroInit(Loc loc)
5190 { 5172 {
5191 return 1; 5173 return 1;