diff --git a/include/pocketpy/interpreter/typeinfo.h b/include/pocketpy/interpreter/typeinfo.h index 9fd8614e..88bf4c0a 100644 --- a/include/pocketpy/interpreter/typeinfo.h +++ b/include/pocketpy/interpreter/typeinfo.h @@ -20,7 +20,6 @@ typedef struct py_TypeInfo { void (*dtor)(void*); py_TValue annotations; - c11_vector /*T=py_Name*/ ordered_attrs; void (*on_end_subclass)(struct py_TypeInfo*); // backdoor for enum module } py_TypeInfo; diff --git a/include/pocketpy/pocketpy.h b/include/pocketpy/pocketpy.h index f947927b..8ff06569 100644 --- a/include/pocketpy/pocketpy.h +++ b/include/pocketpy/pocketpy.h @@ -333,9 +333,6 @@ PK_API py_GlobalRef py_tpfindmagic(py_Type, py_Name name); /// Search the name from the given type to the base type. /// Return `NULL` if not found. PK_API py_ItemRef py_tpfindname(py_Type, py_Name name); -/// Get ordered attributes of the type. -// These attributes must be defined under `class` statement. -PK_API py_Name* py_tpclassattrs(py_Type, int* out_length); /// Get the base type of the given type. PK_API py_Type py_tpbase(py_Type type); diff --git a/src/interpreter/ceval.c b/src/interpreter/ceval.c index 4f1ad49e..c2aec98c 100644 --- a/src/interpreter/ceval.c +++ b/src/interpreter/ceval.c @@ -1092,7 +1092,6 @@ FrameResult VM__run_top_frame(VM* self) { ud->clazz = self->curr_class->_obj; } py_setdict(self->curr_class, name, TOP()); - c11_vector__push(py_Name, &ti->ordered_attrs, name); POP(); DISPATCH(); } diff --git a/src/interpreter/typeinfo.c b/src/interpreter/typeinfo.c index 14b410bf..7d352ae6 100644 --- a/src/interpreter/typeinfo.c +++ b/src/interpreter/typeinfo.c @@ -12,7 +12,7 @@ void TypeList__ctor(TypeList* self) { void TypeList__dtor(TypeList* self) { for(py_Type t = 0; t < self->length; t++) { py_TypeInfo* info = TypeList__get(self, t); - c11_vector__dtor(&info->ordered_attrs); + (void)info; } for(int i = 0; i < PK_MAX_CHUNK_LENGTH; i++) { if(self->chunks[i]) PK_FREE(self->chunks[i]); diff --git a/src/interpreter/vm.c b/src/interpreter/vm.c index fbc90fe4..8f8b038c 100644 --- a/src/interpreter/vm.c +++ b/src/interpreter/vm.c @@ -63,7 +63,6 @@ static void py_TypeInfo__ctor(py_TypeInfo* self, self->module = module; self->annotations = *py_NIL(); - c11_vector__ctor(&self->ordered_attrs, sizeof(py_Name)); } static int BinTree__cmp_cstr(void* lhs, void* rhs) { diff --git a/src/public/internal.c b/src/public/internal.c index 8271b546..d1268624 100644 --- a/src/public/internal.c +++ b/src/public/internal.c @@ -262,12 +262,6 @@ py_Ref py_tpfindname(py_Type t, py_Name name) { return NULL; } -py_Name* py_tpclassattrs(py_Type t, int* out_length) { - py_TypeInfo* ti = pk__type_info(t); - *out_length = ti->ordered_attrs.length; - return ti->ordered_attrs.data; -} - py_Type py_tpbase(py_Type t) { assert(t); py_TypeInfo* ti = pk__type_info(t);