Normalize WTK_declare_typedef -> declare_typedef.
authorW. Trevor King <wking@drexel.edu>
Sun, 6 Mar 2011 03:08:48 +0000 (22:08 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 6 Mar 2011 03:08:48 +0000 (22:08 -0500)
Cython/Compiler/CythonScope.py
Cython/Compiler/Nodes.py
Cython/Compiler/Symtab.py

index deffaffb4b68ee6f3c361b1385e9fb0c3fa3ec3e..52f27d0198667ef3688026420d720dad05a72432 100644 (file)
@@ -1,3 +1,4 @@
+from Binding import Binding
 from Symtab import ModuleScope
 from PyrexTypes import *
 
@@ -32,10 +33,9 @@ def create_utility_scope(context):
     utility_scope = ModuleScope(u'utility', None, context)
 
     # These are used to optimize isinstance in FinalOptimizePhase
-    type_object = utility_scope.declare_typedef('PyTypeObject',
-                                                base_type = c_void_type,
-                                                pos = None,
-                                                cname = 'PyTypeObject')
+    binding = Binding(name = 'PyTypeObject', cname = 'PyTypeObject')
+    type_object = utility_scope.declare_typedef(
+        binding, base_type = c_void_type, pos = None)
     type_object.is_void = True
 
     utility_scope.declare_cfunction(
index eee0037d8e26265569540238a2edd78bcaec93df..91fac61b7e3138685eb906b80659f2a6957dfdc2 100644 (file)
@@ -1026,7 +1026,7 @@ class CStructOrUnionDefNode(StatNode):
                     binding.pull(self)
                     binding.c_visibility = 'ignore'
                     binding.visibility = 'private'
-                    self.entry = env.WTK_declare_typedef(
+                    self.entry = env.declare_typedef(
                         binding, base_type = struct_entry.type, pos = self.pos)
                     struct_entry.type.typedef_flag = False
                     # FIXME: this might be considered a hack ;-)
@@ -1166,7 +1166,7 @@ class CTypeDefNode(StatNode):
         binding.pull(self)
         binding.name = name_declarator.name
         binding.cname = name_declarator.cname
-        entry = env.WTK_declare_typedef(
+        entry = env.declare_typedef(
             binding, base_type = type, pos = self.pos)
         if self.in_pxd and not env.in_cinclude:
             entry.defined_in_pxd = 1
@@ -3495,7 +3495,7 @@ class SingleAssignmentNode(AssignmentNode):
                         binding = Binding(
                             name = lhs.name, c_visibility='private',
                             visibility='public')
-                        env.WTK_declare_typedef(
+                        env.declare_typedef(
                             binding, base_type = type, pos = self.pos)
 
                 elif func_name in ['struct', 'union']:
index 5448bf0009974288b026917708735ebd25860138..9843dc507bb0902d395d1439d1088953ca5e6180 100644 (file)
@@ -410,12 +410,7 @@ class Scope(object):
         # here we would set as_variable to an object representing this type
         return entry
 
-    def declare_typedef(self, name, base_type, pos, cname = None,
-                        visibility = 'private'):
-        binding = self._WTK_setup(name, cname, visibility=visibility)
-        return self.WTK_declare_typedef(binding, base_type, pos)
-
-    def WTK_declare_typedef(self, binding,
+    def declare_typedef(self, binding,
                             base_type, pos):
         if not binding.cname:
             if self.in_cinclude or binding.c_visibility == 'public':