Change the numbering of static ctors/dtors to be module based instead of being global.

This fixes #210 by making sure that the static ctor always gets the same
number, regardless of the order of the modules given at the command line.
This commit is contained in:
Christian Kamm
2009-02-15 11:46:28 +01:00
parent 0676cf018d
commit 89bf7d82d7
3 changed files with 18 additions and 2 deletions
+6
View File
@@ -130,6 +130,7 @@ 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)
@@ -1007,3 +1008,8 @@ DsymbolTable *Package::resolve(Array *packages, Dsymbol **pparent, Package **ppk
}
return dst;
}
Identifier* Module::generateId(Identifier* id)
{
return Identifier::generateId(id->string, uniqueId++);
}