Sfoglia il codice sorgente

* fixed wrong notes about declaring two destructors after r18427:
oo_has_destructor is inherited from the parent class (because it
influences whether a VMT is required for TP-style objects),
so use separate oo_has_new_destructor flag instead

git-svn-id: branches/jvmbackend@18797 -

Jonas Maebe 14 anni fa
parent
commit
8a7982fe9e
3 ha cambiato i file con 6 aggiunte e 3 eliminazioni
  1. 2 1
      compiler/pdecobj.pas
  2. 2 1
      compiler/symconst.pas
  3. 2 1
      compiler/utils/ppudump.pp

+ 2 - 1
compiler/pdecobj.pas

@@ -253,6 +253,7 @@ implementation
           Message(parser_e_no_paras_for_destructor);
         consume(_SEMICOLON);
         include(current_structdef.objectoptions,oo_has_destructor);
+        include(current_structdef.objectoptions,oo_has_new_destructor);
         { no return value }
         pd.returndef:=voidtype;
         constr_destr_finish_head(pd,pd.struct);
@@ -928,7 +929,7 @@ implementation
                 Message(parser_e_cant_have_published);
 
               if not is_classdef then
-                if (oo_has_destructor in astruct.objectoptions) then
+                if (oo_has_new_destructor in astruct.objectoptions) then
                   Message(parser_n_only_one_destructor);
 
               if is_interface(astruct) then

+ 2 - 1
compiler/symconst.pas

@@ -389,7 +389,8 @@ type
     oo_is_classhelper,    { objcclasses that represent categories, and Delpi-style class helpers, are marked like this }
     oo_has_class_constructor, { the object/class has a class constructor }
     oo_has_class_destructor,  { the object/class has a class destructor  }
-    oo_is_enum_class      { the class represents an enum (JVM) }
+    oo_is_enum_class,     { the class represents an enum (JVM) }
+    oo_has_new_destructor { the object/class declares a destructor (apart from potentially inherting one from the parent) }
   );
   tobjectoptions=set of tobjectoption;
 

+ 2 - 1
compiler/utils/ppudump.pp

@@ -1301,7 +1301,8 @@ const
      (mask:oo_is_classhelper;     str:'Class Helper/Category'),
      (mask:oo_has_class_constructor; str:'HasClassConstructor'),
      (mask:oo_has_class_destructor; str:'HasClassDestructor'),
-     (mask:oo_is_enum_class;      str:'JvmEnumClass')
+     (mask:oo_is_enum_class;      str:'JvmEnumClass'),
+     (mask:oo_has_new_destructor; str:'HasNewDestructor')
   );
 var
   i      : longint;