def __init__(self, ptr=None): # FIXME: Rename this to ptr or context_ptr to be consistent with other # API objects self.external_ptr = True if ptr is None: self.external_ptr = False ptr = libcoreir_c.CORENewContext() self.context = ptr self.global_namespace = Namespace( libcoreir_c.COREGetGlobal(self.context), self) self.named_types = NamedTypesDict(self)
def __init__(self): # FIXME: Rename this to ptr or context_ptr to be consistent with other # API objects self.context = libcoreir_c.CORENewContext() self.G = Namespace(libcoreir_c.COREGetGlobal(self.context), self)