From 5471533dd093ad5058c8e0ecc6b997f9a4752779 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 15 Feb 2009 14:50:33 +0100 Subject: [PATCH] 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. --- dmd/func.c | 10 ++-------- dmd/module.c | 6 ------ dmd/module.h | 4 ---- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/dmd/func.c b/dmd/func.c index 89d99d35..aaae4424 100644 --- a/dmd/func.c +++ b/dmd/func.c @@ -2420,7 +2420,7 @@ void DtorDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) StaticCtorDeclaration::StaticCtorDeclaration(Loc loc, Loc endloc) : FuncDeclaration(loc, endloc, - Lexer::idPool("_staticCtor"), STCstatic, NULL) + Identifier::generateId("_staticCtor"), STCstatic, NULL) { } @@ -2438,9 +2438,6 @@ void StaticCtorDeclaration::semantic(Scope *sc) { //printf("StaticCtorDeclaration::semantic()\n"); - // get ourselves a scope-unique id - ident = sc->module->generateId(ident); - type = new TypeFunction(NULL, Type::tvoid, FALSE, LINKd); /* If the static ctor appears within a template instantiation, @@ -2524,7 +2521,7 @@ void StaticCtorDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs) StaticDtorDeclaration::StaticDtorDeclaration(Loc loc, Loc endloc) : FuncDeclaration(loc, endloc, - Lexer::idPool("_staticDtor"), STCstatic, NULL) + Identifier::generateId("_staticDtor"), STCstatic, NULL) { vgate = NULL; } @@ -2541,9 +2538,6 @@ Dsymbol *StaticDtorDeclaration::syntaxCopy(Dsymbol *s) void StaticDtorDeclaration::semantic(Scope *sc) { - // get ourselves a scope-unique id - ident = sc->module->generateId(ident); - ClassDeclaration *cd; Type *tret; diff --git a/dmd/module.c b/dmd/module.c index bd8d563f..0ba1c4cb 100644 --- a/dmd/module.c +++ b/dmd/module.c @@ -130,7 +130,6 @@ Module::Module(char *filename, Identifier *ident, int doDocComment, int doHdrGen llvmForceLogging = false; this->doDocComment = doDocComment; this->doHdrGen = doHdrGen; - uniqueId = 0; } File* Module::buildFilePath(char* forcename, char* path, char* ext) @@ -1008,8 +1007,3 @@ DsymbolTable *Package::resolve(Array *packages, Dsymbol **pparent, Package **ppk } return dst; } - -Identifier* Module::generateId(Identifier* id) -{ - return Identifier::generateId(id->string, uniqueId++); -} diff --git a/dmd/module.h b/dmd/module.h index 2964be36..ac8f103a 100644 --- a/dmd/module.h +++ b/dmd/module.h @@ -179,10 +179,6 @@ struct Module : Package // array ops emitted in this module already StringTable arrayfuncs; - - // for numbering staticCtors etc. - int uniqueId; - Identifier* generateId(Identifier* id); };