Browse Source

compiler: remove unneeded checks and typecasting caused by move of objectoptions into tabstractrecorddef

git-svn-id: branches/paul/extended_records@16542 -
paul 14 years ago
parent
commit
289c9bd192
5 changed files with 8 additions and 9 deletions
  1. 1 1
      compiler/dbgstabs.pas
  2. 1 1
      compiler/ncal.pas
  3. 3 4
      compiler/pdecsub.pas
  4. 2 2
      compiler/symdef.pas
  5. 1 1
      compiler/symtable.pas

+ 1 - 1
compiler/dbgstabs.pas

@@ -783,7 +783,7 @@ implementation
         else
         else
           do_write_object(list,def);
           do_write_object(list,def);
         { VMT symbol }
         { VMT symbol }
-        if (oo_has_vmt in tobjectdef(def).objectoptions) and
+        if (oo_has_vmt in def.objectoptions) and
            assigned(def.owner) and
            assigned(def.owner) and
            assigned(def.owner.name) then
            assigned(def.owner.name) then
           list.concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+GetSymTableName(def.owner)+tobjectdef(def).objname^+':S'+
           list.concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+GetSymTableName(def.owner)+tobjectdef(def).objname^+':S'+

+ 1 - 1
compiler/ncal.pas

@@ -1672,7 +1672,7 @@ implementation
               if (procdefinition.typ<>procdef) then
               if (procdefinition.typ<>procdef) then
                 internalerror(200305062);
                 internalerror(200305062);
               if (tprocdef(procdefinition).struct.typ=objectdef) and
               if (tprocdef(procdefinition).struct.typ=objectdef) and
-                 (oo_has_vmt in tobjectdef(tprocdef(procdefinition).struct).objectoptions) then
+                 (oo_has_vmt in tprocdef(procdefinition).struct.objectoptions) then
                 begin
                 begin
                   { we only need the vmt, loading self is not required and there is no
                   { we only need the vmt, loading self is not required and there is no
                     need to check for typen, because that will always get the
                     need to check for typen, because that will always get the

+ 3 - 4
compiler/pdecsub.pas

@@ -1478,8 +1478,7 @@ begin
   if pd.typ<>procdef then
   if pd.typ<>procdef then
     internalerror(200304269);
     internalerror(200304269);
   if assigned(tprocdef(pd).struct) and
   if assigned(tprocdef(pd).struct) and
-    (tprocdef(pd).struct.typ=objectdef) and
-    (oo_is_sealed in tobjectdef(tprocdef(pd).struct).objectoptions) then
+    (oo_is_sealed in tprocdef(pd).struct.objectoptions) then
     Message(parser_e_sealed_class_cannot_have_abstract_methods)
     Message(parser_e_sealed_class_cannot_have_abstract_methods)
   else
   else
   if (po_virtualmethod in pd.procoptions) then
   if (po_virtualmethod in pd.procoptions) then
@@ -1508,13 +1507,13 @@ begin
   begin
   begin
     if pattern='MOVENEXT' then
     if pattern='MOVENEXT' then
     begin
     begin
-      if oo_has_enumerator_movenext in tobjectdef(tprocdef(pd).struct).objectoptions then
+      if oo_has_enumerator_movenext in tprocdef(pd).struct.objectoptions then
         message(parser_e_only_one_enumerator_movenext);
         message(parser_e_only_one_enumerator_movenext);
       pd.calcparas;
       pd.calcparas;
       if (pd.proctypeoption = potype_function) and is_boolean(pd.returndef) and
       if (pd.proctypeoption = potype_function) and is_boolean(pd.returndef) and
          (pd.minparacount = 0) then
          (pd.minparacount = 0) then
       begin
       begin
-        include(tobjectdef(tprocdef(pd).struct).objectoptions, oo_has_enumerator_movenext);
+        include(tprocdef(pd).struct.objectoptions, oo_has_enumerator_movenext);
         include(pd.procoptions,po_enumerator_movenext);
         include(pd.procoptions,po_enumerator_movenext);
       end
       end
       else
       else

+ 2 - 2
compiler/symdef.pas

@@ -4979,7 +4979,7 @@ implementation
             else
             else
               { all checks already done }
               { all checks already done }
               exit;
               exit;
-            if not((pd.struct.typ=objectdef)and(oo_is_external in tobjectdef(pd.struct).objectoptions)) then
+            if not(oo_is_external in pd.struct.objectoptions) then
               begin
               begin
                 if (po_varargs in pd.procoptions) then
                 if (po_varargs in pd.procoptions) then
                   MessagePos(pd.fileinfo,parser_e_varargs_need_cdecl_and_external)
                   MessagePos(pd.fileinfo,parser_e_varargs_need_cdecl_and_external)
@@ -5074,7 +5074,7 @@ implementation
         if (def.typ=procdef) then
         if (def.typ=procdef) then
           begin
           begin
             pd.setmangledname(target_info.Cprefix+pd.cplusplusmangledname);
             pd.setmangledname(target_info.Cprefix+pd.cplusplusmangledname);
-            if (pd.struct.typ=objectdef) and (oo_is_external in tobjectdef(pd.struct).objectoptions) then
+            if (oo_is_external in pd.struct.objectoptions) then
               begin
               begin
                 { copied from psub.read_proc }
                 { copied from psub.read_proc }
                 if assigned(tobjectdef(pd.struct).import_lib) then
                 if assigned(tobjectdef(pd.struct).import_lib) then

+ 1 - 1
compiler/symtable.pas

@@ -2446,7 +2446,7 @@ implementation
         srsymtable : tsymtable;
         srsymtable : tsymtable;
       begin
       begin
         { in case this is a formal objcclass, first find the real definition }
         { in case this is a formal objcclass, first find the real definition }
-        if (pd.typ=objectdef) and (oo_is_formal in tobjectdef(pd).objectoptions) then
+        if (oo_is_formal in pd.objectoptions) then
           pd:=find_real_objcclass_definition(tobjectdef(pd),true);
           pd:=find_real_objcclass_definition(tobjectdef(pd),true);
         hashedid.id:=s;
         hashedid.id:=s;
         orgpd:=pd;
         orgpd:=pd;