* renamed is_refcounted_type() into is_managed_type(), because it also

returns true for variants and those aren't refcounted
  * also allow tempnodes for pointers to managed types to be put in
    registers (not sure why it was disabled, and there are no
    testsuite regressions by enabling it)

git-svn-id: trunk@15319 -
This commit is contained in:
Jonas Maebe 2010-05-22 20:51:50 +00:00
parent e9b62c1294
commit 40705a085f
4 changed files with 5 additions and 8 deletions

View File

@ -99,7 +99,7 @@ interface
function is_in_limit(def_from,def_to : tdef) : boolean;
{# Returns whether def is reference counted }
function is_refcounted_type(def: tdef) : boolean;
function is_managed_type(def: tdef) : boolean;
{ function is_in_limit_value(val_from:TConstExprInt;def_from,def_to : tdef) : boolean;}
@ -526,7 +526,7 @@ implementation
end;
function is_refcounted_type(def: tdef): boolean;
function is_managed_type(def: tdef): boolean;
begin
result:=
def.needs_inittable and

View File

@ -712,10 +712,7 @@ implementation
{ size of register operations must be known }
(def_cgsize(_typedef)<>OS_NO) and
{ no init/final needed }
not (_typedef.needs_inittable) and
((_typedef.typ <> pointerdef) or
(is_object(tpointerdef(_typedef).pointeddef) or
not tpointerdef(_typedef).pointeddef.needs_inittable)) then
not is_managed_type(_typedef) then
include(tempinfo^.flags,ti_may_be_in_reg);
end;

View File

@ -1725,7 +1725,7 @@ implementation
{ some conversions, like dynarray to pointer in Delphi
mode, must not be removed, because then we get memory
leaks due to missing temp finalization }
(not is_refcounted_type(left.resultdef) or
(not is_managed_type(left.resultdef) or
{ different kinds of refcounted types may need calls
to different kinds of refcounting helpers }
(resultdef=left.resultdef)) then

View File

@ -440,7 +440,7 @@ implementation
Message(parser_e_no_local_para_def);
consume(_OF);
single_type(t2,false,false);
if is_refcounted_type(t2) then
if is_managed_type(t2) then
Message(parser_e_no_refcounted_typed_file);
def:=tfiledef.createtyped(t2);
end