Jelajahi Sumber

* Renamed IIOffset to FieldOffset to avoid confusion with IOffset (TImplementedInterface)

git-svn-id: trunk@6219 -
chrivers 18 tahun lalu
induk
melakukan
0249f07fa9
3 mengubah file dengan 16 tambahan dan 16 penghapusan
  1. 5 5
      compiler/nobj.pas
  2. 3 2
      compiler/pdecvar.pas
  3. 8 9
      compiler/symdef.pas

+ 5 - 5
compiler/nobj.pas

@@ -521,7 +521,7 @@ implementation
                     ImplIntf.AddImplProc(implprocdef)
                   end
                 else
-                  if ImplIntf.itype = etStandard then
+                  if ImplIntf.VtblImplIntf.IType = etStandard then
                     Message1(sym_e_no_matching_implementation_found,tprocdef(def).fullprocname(false));
               end;
           end;
@@ -1221,10 +1221,10 @@ implementation
         { VTable }
         current_asmdata.asmlists[al_globals].concat(Tai_const.Createname(intf_get_vtbl_name(AImplIntf.VtblImplIntf),0));
         { IOffset field }
-        if AImplIntf.VtblImplIntf.itype = etStandard then
-          current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(AImplIntf.VtblImplIntf.ioffset))
+        if AImplIntf.VtblImplIntf.IType = etStandard then
+          current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(AImplIntf.VtblImplIntf.IOffset))
         else
-          current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(AImplIntf.VtblImplIntf.iioffset));
+          current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(AImplIntf.VtblImplIntf.FieldOffset));
         { IIDStr }
         current_asmdata.getdatalabel(iidlabel);
         rawdata.concat(cai_align.create(const_align(sizeof(aint))));
@@ -1236,7 +1236,7 @@ implementation
           rawdata.concat(Tai_string.Create(AImplIntf.IntfDef.iidstr^));
         current_asmdata.asmlists[al_globals].concat(Tai_const.Create_sym(iidlabel));
         { IType }
-        current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(aint(AImplIntf.itype)));
+        current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(aint(AImplIntf.VtblImplIntf.IType)));
       end;
 
 

+ 3 - 2
compiler/pdecvar.pas

@@ -643,6 +643,7 @@ implementation
                for i:=0 to aclass.ImplementedInterfaces.Count-1 do
                begin
                  ImplIntf:=TImplementedInterface(aclass.ImplementedInterfaces[i]);
+                 { FIXME: Is this check valid? }
                  if ImplIntf.IntfDef.Objname^=pattern then
                  begin
                    found:=true;
@@ -651,8 +652,8 @@ implementation
                end;
                if found then
                begin
-                 ImplIntf.itype := etFieldValue;
-                 ImplIntf.iioffset := tfieldvarsym(p.propaccesslist[palt_read].firstsym^.sym).fieldoffset;
+                 ImplIntf.IType := etFieldValue;
+                 ImplIntf.FieldOffset := tfieldvarsym(p.propaccesslist[palt_read].firstsym^.sym).fieldoffset;
                end
                else
                  Comment(V_Error, 'Implements-property used on unimplemented interface');

+ 8 - 9
compiler/symdef.pas

@@ -204,10 +204,10 @@ interface
          VtblImplIntf : TImplementedInterface;
          NameMappings : TFPHashList;
          ProcDefs     : TFPObjectList;
-         // IIOffset can be merged with IOffset. But then, fpc is not allowed to genrate a vmtentry.
+         // FieldOffset can be merged with IOffset. But then, fpc is not allowed to genrate a vmtentry.
          // Right now, fpc generate an entry for all implemented interfaces (but it should just for etStandard ones)
          // - Ivo Steinmann
-         iioffset     : longint;
+         FieldOffset     : longint;
          constructor create(aintf: tobjectdef);
          constructor create_deref(d:tderef);
          destructor  destroy; override;
@@ -4028,12 +4028,11 @@ implementation
       begin
         inherited create;
         intfdef:=aintf;
-        ioffset:=-1;
-        itype:=etStandard;
-        iioffset:=-1;
+        IOffset:=-1;
+        IType:=etStandard;
+        FieldOffset:=-1;
         NameMappings:=nil;
         procdefs:=nil;
-        iioffset := 0;
       end;
 
 
@@ -4042,9 +4041,9 @@ implementation
         inherited create;
         intfdef:=nil;
         intfdefderef:=d;
-        ioffset:=-1;
-        itype:=etStandard;
-        iioffset:=-1;
+        IOffset:=-1;
+        IType:=etStandard;
+        FieldOffset:=-1;
         NameMappings:=nil;
         procdefs:=nil;
       end;