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

git-svn-id: branches/paul/extended_records@16542 -
This commit is contained in:
paul 2010-12-11 07:00:46 +00:00
parent 4f274b157c
commit 289c9bd192
5 changed files with 8 additions and 9 deletions

View File

@ -783,7 +783,7 @@ implementation
else
do_write_object(list,def);
{ 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.name) then
list.concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+GetSymTableName(def.owner)+tobjectdef(def).objname^+':S'+

View File

@ -1672,7 +1672,7 @@ implementation
if (procdefinition.typ<>procdef) then
internalerror(200305062);
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
{ 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

View File

@ -1478,8 +1478,7 @@ begin
if pd.typ<>procdef then
internalerror(200304269);
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)
else
if (po_virtualmethod in pd.procoptions) then
@ -1508,13 +1507,13 @@ begin
begin
if pattern='MOVENEXT' then
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);
pd.calcparas;
if (pd.proctypeoption = potype_function) and is_boolean(pd.returndef) and
(pd.minparacount = 0) then
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);
end
else

View File

@ -4979,7 +4979,7 @@ implementation
else
{ all checks already done }
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
if (po_varargs in pd.procoptions) then
MessagePos(pd.fileinfo,parser_e_varargs_need_cdecl_and_external)
@ -5074,7 +5074,7 @@ implementation
if (def.typ=procdef) then
begin
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
{ copied from psub.read_proc }
if assigned(tobjectdef(pd.struct).import_lib) then

View File

@ -2446,7 +2446,7 @@ implementation
srsymtable : tsymtable;
begin
{ 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);
hashedid.id:=s;
orgpd:=pd;