blueloveTH 8 tháng trước cách đây
mục cha
commit
c29b389c78

+ 0 - 1
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;

+ 0 - 3
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);
 

+ 0 - 1
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();
             }

+ 1 - 1
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]);

+ 0 - 1
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) {

+ 0 - 6
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);