Mercurial > projects > ddmd
diff dmd/Global.d @ 169:e7769d53e750
Moves static variables from Module to Global
author | korDen |
---|---|
date | Thu, 30 Sep 2010 13:29:54 +0400 |
parents | ceed63f310fb |
children | 96c0fff6897d |
line wrap: on
line diff
--- a/dmd/Global.d Thu Sep 30 12:57:13 2010 +0400 +++ b/dmd/Global.d Thu Sep 30 13:29:54 2010 +0400 @@ -8,6 +8,10 @@ import dmd.StringTable; import dmd.OutBuffer; import dmd.Token; +import dmd.Module; + +import core.stdc.time; +import core.stdc.stdio; class Global { @@ -67,12 +71,44 @@ OutBuffer stringbuffer; Token* freelist; + char date[11+1]; + char time[8+1]; + char timestamp[24+1]; + + // Used in Module + Module rootModule; + DsymbolTable modules; // symbol table of all modules + Array amodules; // array of all modules + Array deferred; // deferred Dsymbol's needing semantic() run on them + uint dprogress; // progress resolving the deferred list + + ClassDeclaration moduleinfo; + this() { params.versionids = new Array(); st = new DsymbolTable(); stringtable = new StringTable(); stringbuffer = new OutBuffer(); + + modules = new DsymbolTable(); + amodules = new Array(); + deferred = new Array(); + + init_time(); + } + + void init_time() + { + time_t tm; + char* p; + + .time(&tm); + p = ctime(&tm); + assert(p); + sprintf(date.ptr, "%.6s %.4s", p + 4, p + 20); + sprintf(time.ptr, "%.8s", p + 11); + sprintf(timestamp.ptr, "%.24s", p); } }