Mercurial > projects > ldc
comparison dmd/func.c @ 19:788401029ecf trunk
[svn r23] * Updated to DMD 1.021
author | lindquist |
---|---|
date | Thu, 04 Oct 2007 03:42:56 +0200 |
parents | 37a4fdab33fc |
children | 3cfcb944304e |
comparison
equal
deleted
inserted
replaced
18:c05ef76f1c20 | 19:788401029ecf |
---|---|
253 | 253 |
254 // if static function, do not put in vtbl[] | 254 // if static function, do not put in vtbl[] |
255 if (!isVirtual()) | 255 if (!isVirtual()) |
256 { | 256 { |
257 //printf("\tnot virtual\n"); | 257 //printf("\tnot virtual\n"); |
258 return; | 258 goto Ldone; |
259 } | 259 } |
260 | 260 |
261 // Find index of existing function in vtbl[] to override | 261 // Find index of existing function in vtbl[] to override |
262 if (cd->baseClass) | 262 if (cd->baseClass) |
263 { | 263 { |
403 { | 403 { |
404 ti = fdv->type; | 404 ti = fdv->type; |
405 #if 0 | 405 #if 0 |
406 if (offset) | 406 if (offset) |
407 ti = fdv->type; | 407 ti = fdv->type; |
408 else if (type->next->ty == Tclass) | 408 else if (type->nextOf()->ty == Tclass) |
409 { ClassDeclaration *cdn = ((TypeClass *)type->next)->sym; | 409 { ClassDeclaration *cdn = ((TypeClass *)type->nextOf())->sym; |
410 if (cdn && cdn->sizeok != 1) | 410 if (cdn && cdn->sizeok != 1) |
411 ti = fdv->type; | 411 ti = fdv->type; |
412 } | 412 } |
413 #endif | 413 #endif |
414 } | 414 } |
478 | 478 |
479 case 1: | 479 case 1: |
480 { | 480 { |
481 Argument *arg0 = Argument::getNth(f->parameters, 0); | 481 Argument *arg0 = Argument::getNth(f->parameters, 0); |
482 if (arg0->type->ty != Tarray || | 482 if (arg0->type->ty != Tarray || |
483 arg0->type->next->ty != Tarray || | 483 arg0->type->nextOf()->ty != Tarray || |
484 arg0->type->next->next->ty != Tchar || | 484 arg0->type->nextOf()->nextOf()->ty != Tchar || |
485 arg0->storageClass & (STCout | STCref | STClazy)) | 485 arg0->storageClass & (STCout | STCref | STClazy)) |
486 goto Lmainerr; | 486 goto Lmainerr; |
487 break; | 487 break; |
488 } | 488 } |
489 | 489 |
524 goto Lassignerr; | 524 goto Lassignerr; |
525 } | 525 } |
526 } | 526 } |
527 } | 527 } |
528 | 528 |
529 Ldone: | |
529 /* Save scope for possible later use (if we need the | 530 /* Save scope for possible later use (if we need the |
530 * function internals) | 531 * function internals) |
531 */ | 532 */ |
532 scope = new Scope(*sc); | 533 scope = new Scope(*sc); |
533 scope->setNoFree(); | 534 scope->setNoFree(); |
2183 } | 2184 } |
2184 | 2185 |
2185 /********************************* StaticCtorDeclaration ****************************/ | 2186 /********************************* StaticCtorDeclaration ****************************/ |
2186 | 2187 |
2187 StaticCtorDeclaration::StaticCtorDeclaration(Loc loc, Loc endloc) | 2188 StaticCtorDeclaration::StaticCtorDeclaration(Loc loc, Loc endloc) |
2188 : FuncDeclaration(loc, endloc, Id::staticCtor, STCstatic, NULL) | 2189 : FuncDeclaration(loc, endloc, |
2190 Identifier::generateId("_staticCtor"), STCstatic, NULL) | |
2189 { | 2191 { |
2190 } | 2192 } |
2191 | 2193 |
2192 Dsymbol *StaticCtorDeclaration::syntaxCopy(Dsymbol *s) | 2194 Dsymbol *StaticCtorDeclaration::syntaxCopy(Dsymbol *s) |
2193 { | 2195 { |
2255 } | 2257 } |
2256 | 2258 |
2257 /********************************* StaticDtorDeclaration ****************************/ | 2259 /********************************* StaticDtorDeclaration ****************************/ |
2258 | 2260 |
2259 StaticDtorDeclaration::StaticDtorDeclaration(Loc loc, Loc endloc) | 2261 StaticDtorDeclaration::StaticDtorDeclaration(Loc loc, Loc endloc) |
2260 : FuncDeclaration(loc, endloc, Id::staticDtor, STCstatic, NULL) | 2262 : FuncDeclaration(loc, endloc, |
2263 Identifier::generateId("_staticDtor"), STCstatic, NULL) | |
2261 { | 2264 { |
2262 } | 2265 } |
2263 | 2266 |
2264 Dsymbol *StaticDtorDeclaration::syntaxCopy(Dsymbol *s) | 2267 Dsymbol *StaticDtorDeclaration::syntaxCopy(Dsymbol *s) |
2265 { | 2268 { |