[svn:parrot] r36385 - trunk/compilers/imcc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Thu Feb 5 17:22:17 UTC 2009


Author: NotFound
Date: Thu Feb  5 17:22:16 2009
New Revision: 36385
URL: https://trac.parrot.org/parrot/changeset/36385

Log:
[imcc] drop EXTERN qualifier from the _namespace symbol, make it static and rename it creatively

Modified:
   trunk/compilers/imcc/symreg.c
   trunk/compilers/imcc/symreg.h

Modified: trunk/compilers/imcc/symreg.c
==============================================================================
--- trunk/compilers/imcc/symreg.c	Thu Feb  5 16:33:26 2009	(r36384)
+++ trunk/compilers/imcc/symreg.c	Thu Feb  5 17:22:16 2009	(r36385)
@@ -30,6 +30,9 @@
 #include "imc.h"
 
 /* Globals: */
+
+static Namespace * pesky_global__namespace;
+
 /* Code: */
 
 /* HEADERIZER HFILE: compilers/imcc/symreg.h */
@@ -130,9 +133,9 @@
     ASSERT_ARGS(push_namespace)
     Namespace * const ns = mem_allocate_zeroed_typed(Namespace);
 
-    ns->parent = _namespace;
+    ns->parent = pesky_global__namespace;
     ns->name   = str_dup(name);
-    _namespace = ns;
+    pesky_global__namespace = ns;
 }
 
 
@@ -151,7 +154,7 @@
 pop_namespace(PARROT_INTERP, ARGIN(const char *name))
 {
     ASSERT_ARGS(pop_namespace)
-    Namespace * const ns = _namespace;
+    Namespace * const ns = pesky_global__namespace;
 
     if (!ns)
         IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR, "pop() on empty namespace stack\n");
@@ -166,7 +169,7 @@
         mem_sys_free(ident);
     }
 
-    _namespace = ns->parent;
+    pesky_global__namespace = ns->parent;
     mem_sys_free(ns);
 }
 
@@ -589,17 +592,17 @@
 mk_ident(PARROT_INTERP, ARGIN(const char *name), int t)
 {
     ASSERT_ARGS(mk_ident)
-    char   * const fullname = _mk_fullname(_namespace, name);
+    char   * const fullname = _mk_fullname(pesky_global__namespace, name);
     SymReg        *r        = mk_symreg(interp, fullname, t);
 
     r->type = VTIDENTIFIER;
 
-    if (_namespace) {
+    if (pesky_global__namespace) {
         Identifier * const ident = mem_allocate_zeroed_typed(Identifier);
 
         ident->name        = fullname;
-        ident->next        = _namespace->idents;
-        _namespace->idents = ident;
+        ident->next        = pesky_global__namespace->idents;
+        pesky_global__namespace->idents = ident;
     }
     else
         mem_sys_free(fullname);
@@ -1472,7 +1475,7 @@
 {
     ASSERT_ARGS(find_sym)
     if (IMCC_INFO(interp)->cur_unit)
-        return _find_sym(interp, _namespace,
+        return _find_sym(interp, pesky_global__namespace,
             &IMCC_INFO(interp)->cur_unit->hash, name);
 
     return NULL;

Modified: trunk/compilers/imcc/symreg.h
==============================================================================
--- trunk/compilers/imcc/symreg.h	Thu Feb  5 16:33:26 2009	(r36384)
+++ trunk/compilers/imcc/symreg.h	Thu Feb  5 17:22:16 2009	(r36385)
@@ -108,8 +108,6 @@
     Identifier *idents;
 };
 
-EXTERN Namespace * _namespace;
-
 struct _IMC_Unit;
 
 /* functions */


More information about the parrot-commits mailing list