+from Binding import Binding
from Symtab import ModuleScope
from PyrexTypes import *
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(
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 ;-)
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
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']:
# 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':