Browse Source

* 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 years ago
parent
commit
2bd2e03309
3 changed files with 15 additions and 9 deletions
  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;
       accessorname: string;
       callthroughprop: tpropertysym;
       callthroughprop: tpropertysym;
       accesstyp: tpropaccesslisttypes;
       accesstyp: tpropaccesslisttypes;
-      sktype: tsynthetickind;
+      accessortyp: tprocoption;
       procoptions: tprocoptions;
       procoptions: tprocoptions;
       paranr: word;
       paranr: word;
       explicitwrapper: boolean;
       explicitwrapper: boolean;
@@ -273,7 +273,11 @@ implementation
           (not getter and
           (not getter and
            (prop_auto_setter_prefix<>''));
            (prop_auto_setter_prefix<>''));
         sym:=nil;
         sym:=nil;
-        procoptions:=[];
+        if getter then
+          accessortyp:=po_is_auto_getter
+        else
+          accessortyp:=po_is_auto_setter;
+        procoptions:=[accessortyp];
         if explicitwrapper then
         if explicitwrapper then
           begin
           begin
             if getter then
             if getter then
@@ -281,15 +285,11 @@ implementation
             else
             else
               accessorname:=prop_auto_setter_prefix+realname;
               accessorname:=prop_auto_setter_prefix+realname;
             sym:=search_struct_member_no_helper(obj,upper(accessorname));
             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
             if assigned(sym) then
               begin
               begin
                 if ((sym.typ<>procsym) or
                 if ((sym.typ<>procsym) or
                     (tprocsym(sym).procdeflist.count<>1) 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
                    (not assigned(orgaccesspd) or
                     (sym<>orgaccesspd.procsym)) then
                     (sym<>orgaccesspd.procsym)) then
                   begin
                   begin

+ 5 - 1
compiler/symconst.pas

@@ -392,7 +392,11 @@ type
     { procvar is a function reference }
     { procvar is a function reference }
     po_is_function_ref,
     po_is_function_ref,
     { procvar is a block (http://en.wikipedia.org/wiki/Blocks_(C_language_extension) ) }
     { 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;
   tprocoptions=set of tprocoption;
 
 

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

@@ -1859,7 +1859,9 @@ const
      (mask:po_far;             str: 'Far'),
      (mask:po_far;             str: 'Far'),
      (mask:po_noreturn;        str: 'No return'),
      (mask:po_noreturn;        str: 'No return'),
      (mask:po_is_function_ref; str: 'Function reference'),
      (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
 var
   proctypeoption  : tproctypeoption;
   proctypeoption  : tproctypeoption;