comparison dmd/func.c @ 957:31bbc7f3b817

Backed out changeset [369996c08420]. The argument and order dependent numbering of static ctors/dtors generally doesn't matter because other modules shouldn't reference their symbols. The next changeset will fix a LDC bug that caused such references within ModuleInfo.
author Christian Kamm <kamm incasoftware de>
date Sun, 15 Feb 2009 14:50:33 +0100
parents 369996c08420
children b30fe7e1dbb9
comparison
equal deleted inserted replaced
956:369996c08420 957:31bbc7f3b817
2418 2418
2419 /********************************* StaticCtorDeclaration ****************************/ 2419 /********************************* StaticCtorDeclaration ****************************/
2420 2420
2421 StaticCtorDeclaration::StaticCtorDeclaration(Loc loc, Loc endloc) 2421 StaticCtorDeclaration::StaticCtorDeclaration(Loc loc, Loc endloc)
2422 : FuncDeclaration(loc, endloc, 2422 : FuncDeclaration(loc, endloc,
2423 Lexer::idPool("_staticCtor"), STCstatic, NULL) 2423 Identifier::generateId("_staticCtor"), STCstatic, NULL)
2424 { 2424 {
2425 } 2425 }
2426 2426
2427 Dsymbol *StaticCtorDeclaration::syntaxCopy(Dsymbol *s) 2427 Dsymbol *StaticCtorDeclaration::syntaxCopy(Dsymbol *s)
2428 { 2428 {
2435 2435
2436 2436
2437 void StaticCtorDeclaration::semantic(Scope *sc) 2437 void StaticCtorDeclaration::semantic(Scope *sc)
2438 { 2438 {
2439 //printf("StaticCtorDeclaration::semantic()\n"); 2439 //printf("StaticCtorDeclaration::semantic()\n");
2440
2441 // get ourselves a scope-unique id
2442 ident = sc->module->generateId(ident);
2443 2440
2444 type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd); 2441 type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd);
2445 2442
2446 /* If the static ctor appears within a template instantiation, 2443 /* If the static ctor appears within a template instantiation,
2447 * it could get called multiple times by the module constructors 2444 * it could get called multiple times by the module constructors
2522 2519
2523 /********************************* StaticDtorDeclaration ****************************/ 2520 /********************************* StaticDtorDeclaration ****************************/
2524 2521
2525 StaticDtorDeclaration::StaticDtorDeclaration(Loc loc, Loc endloc) 2522 StaticDtorDeclaration::StaticDtorDeclaration(Loc loc, Loc endloc)
2526 : FuncDeclaration(loc, endloc, 2523 : FuncDeclaration(loc, endloc,
2527 Lexer::idPool("_staticDtor"), STCstatic, NULL) 2524 Identifier::generateId("_staticDtor"), STCstatic, NULL)
2528 { 2525 {
2529 vgate = NULL; 2526 vgate = NULL;
2530 } 2527 }
2531 2528
2532 Dsymbol *StaticDtorDeclaration::syntaxCopy(Dsymbol *s) 2529 Dsymbol *StaticDtorDeclaration::syntaxCopy(Dsymbol *s)
2539 } 2536 }
2540 2537
2541 2538
2542 void StaticDtorDeclaration::semantic(Scope *sc) 2539 void StaticDtorDeclaration::semantic(Scope *sc)
2543 { 2540 {
2544 // get ourselves a scope-unique id
2545 ident = sc->module->generateId(ident);
2546
2547 ClassDeclaration *cd; 2541 ClassDeclaration *cd;
2548 Type *tret; 2542 Type *tret;
2549 2543
2550 cd = sc->scopesym->isClassDeclaration(); 2544 cd = sc->scopesym->isClassDeclaration();
2551 if (!cd) 2545 if (!cd)