diff dmd/module.c @ 956:369996c08420

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.
author Christian Kamm <kamm incasoftware de>
date Sun, 15 Feb 2009 11:46:28 +0100
parents 330f999ade44
children 31bbc7f3b817
line wrap: on
line diff
--- a/dmd/module.c	Sat Feb 14 21:18:47 2009 +0100
+++ b/dmd/module.c	Sun Feb 15 11:46:28 2009 +0100
@@ -130,6 +130,7 @@
     llvmForceLogging = false;
     this->doDocComment = doDocComment;
     this->doHdrGen = doHdrGen;
+    uniqueId = 0;
 }
 
 File* Module::buildFilePath(char* forcename, char* path, char* ext)
@@ -1007,3 +1008,8 @@
     }
     return dst;
 }
+
+Identifier* Module::generateId(Identifier* id)
+{
+    return Identifier::generateId(id->string, uniqueId++);
+}