Mercurial > projects > ddmd
diff dmd/FuncDeclaration.d @ 167:50a6d232176c
rewrite GlobalExpressions, moved DsymbolTable to Global, some cleanup
author | korDen |
---|---|
date | Thu, 30 Sep 2010 12:13:49 +0400 |
parents | 80f4806ffa13 |
children | af724d3510d7 |
line wrap: on
line diff
--- a/dmd/FuncDeclaration.d Thu Sep 30 10:30:15 2010 +0400 +++ b/dmd/FuncDeclaration.d Thu Sep 30 12:13:49 2010 +0400 @@ -2210,7 +2210,7 @@ */ BUILTIN isBuiltin() { - static string FeZe = "FNaNbeZe"; // pure nothrow real function(real) + enum FeZe = "FNaNbeZe"; // pure nothrow real function(real) //printf("FuncDeclaration::isBuiltin() %s\n", toChars()); if (builtin == BUILTIN.BUILTINunknown) @@ -3101,21 +3101,17 @@ FuncDeclaration fd; TypeFunction tf; Dsymbol s; - static DsymbolTable st = null; //printf("genCfunc(name = '%s')\n", id.toChars()); //printf("treturn\n\t"); treturn.print(); // See if already in table - if (!st) - st = new DsymbolTable(); - - s = st.lookup(id); + s = global.st.lookup(id); if (s) { - fd = s.isFuncDeclaration(); - assert(fd); - assert(fd.type.nextOf().equals(treturn)); + debug fd = s.isFuncDeclaration(); + debug assert(fd); + debug assert(fd.type.nextOf().equals(treturn)); } else { @@ -3124,7 +3120,7 @@ fd.protection = PROT.PROTpublic; fd.linkage = LINK.LINKc; - st.insert(fd); + global.st.insert(fd); } return fd; }