Bläddra i källkod

* no longer use the synthetickind field of a procdef to determine whether
it's an automatically generated getter/setter, but a procoption. This
way we no longer have to save/restore the synthetickind procdef field
to/from ppu's. This way we can modify the field also after the interface
has been parsed without affecting the crc (e.g. when creating wrappers
for high level targets for routines that are only declared as "external"
in the implementation)

git-svn-id: trunk@34129 -

Jonas Maebe 9 år sedan
förälder
incheckning
2bd2e03309
3 ändrade filer med 15 tillägg och 9 borttagningar
  1. 7 7
      compiler/jvm/symcpu.pas
  2. 5 1
      compiler/symconst.pas
  3. 3 1
      compiler/utils/ppuutils/ppudump.pp

+ 7 - 7
compiler/jvm/symcpu.pas

@@ -241,7 +241,7 @@ implementation
       accessorname: string;
       callthroughprop: tpropertysym;
       accesstyp: tpropaccesslisttypes;
-      sktype: tsynthetickind;
+      accessortyp: tprocoption;
       procoptions: tprocoptions;
       paranr: word;
       explicitwrapper: boolean;
@@ -273,7 +273,11 @@ implementation
           (not getter and
            (prop_auto_setter_prefix<>''));
         sym:=nil;
-        procoptions:=[];
+        if getter then
+          accessortyp:=po_is_auto_getter
+        else
+          accessortyp:=po_is_auto_setter;
+        procoptions:=[accessortyp];
         if explicitwrapper then
           begin
             if getter then
@@ -281,15 +285,11 @@ implementation
             else
               accessorname:=prop_auto_setter_prefix+realname;
             sym:=search_struct_member_no_helper(obj,upper(accessorname));
-            if getter then
-              sktype:=tsk_field_getter
-            else
-              sktype:=tsk_field_setter;
             if assigned(sym) then
               begin
                 if ((sym.typ<>procsym) or
                     (tprocsym(sym).procdeflist.count<>1) or
-                    (tprocdef(tprocsym(sym).procdeflist[0]).synthetickind<>sktype)) and
+                    not(accessortyp in tprocdef(tprocsym(sym).procdeflist[0]).procoptions)) and
                    (not assigned(orgaccesspd) or
                     (sym<>orgaccesspd.procsym)) then
                   begin

+ 5 - 1
compiler/symconst.pas

@@ -392,7 +392,11 @@ type
     { procvar is a function reference }
     po_is_function_ref,
     { procvar is a block (http://en.wikipedia.org/wiki/Blocks_(C_language_extension) ) }
-    po_is_block
+    po_is_block,
+    { procedure is an automatically generated property getter }
+    po_is_auto_getter,
+    { procedure is an automatically generated property setter }
+    po_is_auto_setter
   );
   tprocoptions=set of tprocoption;
 

+ 3 - 1
compiler/utils/ppuutils/ppudump.pp

@@ -1859,7 +1859,9 @@ const
      (mask:po_far;             str: 'Far'),
      (mask:po_noreturn;        str: 'No return'),
      (mask:po_is_function_ref; str: 'Function reference'),
-     (mask:po_is_block;        str: 'C "Block"')
+     (mask:po_is_block;        str: 'C "Block"'),
+     (mask:po_is_auto_getter;  str: 'Automatically generated getter'),
+     (mask:po_is_auto_setter;  str: 'Automatically generated setter')
   );
 var
   proctypeoption  : tproctypeoption;