comparison dmd/mtype.c @ 1245:465a77c904d4

Fixed all issues preventing Tango 0.99.8 to compile with `sh build-tango.sh --verbose ldc'.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Fri, 17 Apr 2009 14:38:29 +0200
parents 79758fd2f48a
children 7af860e4f403
comparison
equal deleted inserted replaced
1244:e1b0c5c74c58 1245:465a77c904d4
106 106
107 Type *Type::tvoidptr; 107 Type *Type::tvoidptr;
108 Type *Type::basic[TMAX]; 108 Type *Type::basic[TMAX];
109 unsigned char Type::mangleChar[TMAX]; 109 unsigned char Type::mangleChar[TMAX];
110 StringTable Type::stringtable; 110 StringTable Type::stringtable;
111
112 #if IN_LLVM
113 StringTable Type::deco_stringtable;
114 #endif
111 115
112 116
113 Type::Type(TY ty, Type *next) 117 Type::Type(TY ty, Type *next)
114 { 118 {
115 this->ty = ty; 119 this->ty = ty;
442 //printf("old value, deco = '%s' %p\n", t->deco, t->deco); 446 //printf("old value, deco = '%s' %p\n", t->deco, t->deco);
443 } 447 }
444 else 448 else
445 { 449 {
446 sv->ptrvalue = this; 450 sv->ptrvalue = this;
447 451
452 // we still need deco strings to be unique
453 // or Type::equals fails, which breaks a bunch of stuff,
454 // like covariant member function overloads.
448 OutBuffer mangle; 455 OutBuffer mangle;
449 toDecoBuffer(&mangle, true); 456 toDecoBuffer(&mangle, true);
450 mangle.writeByte(0); 457 StringValue* sv2 = deco_stringtable.update((char *)mangle.data, mangle.offset);
451 deco = mem.strdup((char *)mangle.data); 458 if (sv2->ptrvalue)
459 { Type* t2 = (Type *) sv2->ptrvalue;
460 assert(t2->deco);
461 deco = t2->deco;
462 }
463 else
464 {
465 sv2->ptrvalue = this;
466 deco = (char *)sv2->lstring.string;
467 }
452 //printf("new value, deco = '%s' %p\n", t->deco, t->deco); 468 //printf("new value, deco = '%s' %p\n", t->deco, t->deco);
453 } 469 }
454 } 470 }
455 return t; 471 return t;
456 } 472 }