mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 20:50:32 +02:00
* 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:
parent
e9b62c1294
commit
40705a085f
@ -99,7 +99,7 @@ interface
|
|||||||
function is_in_limit(def_from,def_to : tdef) : boolean;
|
function is_in_limit(def_from,def_to : tdef) : boolean;
|
||||||
|
|
||||||
{# Returns whether def is reference counted }
|
{# 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;}
|
{ function is_in_limit_value(val_from:TConstExprInt;def_from,def_to : tdef) : boolean;}
|
||||||
@ -526,7 +526,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function is_refcounted_type(def: tdef): boolean;
|
function is_managed_type(def: tdef): boolean;
|
||||||
begin
|
begin
|
||||||
result:=
|
result:=
|
||||||
def.needs_inittable and
|
def.needs_inittable and
|
||||||
|
@ -712,10 +712,7 @@ implementation
|
|||||||
{ size of register operations must be known }
|
{ size of register operations must be known }
|
||||||
(def_cgsize(_typedef)<>OS_NO) and
|
(def_cgsize(_typedef)<>OS_NO) and
|
||||||
{ no init/final needed }
|
{ no init/final needed }
|
||||||
not (_typedef.needs_inittable) and
|
not is_managed_type(_typedef) then
|
||||||
((_typedef.typ <> pointerdef) or
|
|
||||||
(is_object(tpointerdef(_typedef).pointeddef) or
|
|
||||||
not tpointerdef(_typedef).pointeddef.needs_inittable)) then
|
|
||||||
include(tempinfo^.flags,ti_may_be_in_reg);
|
include(tempinfo^.flags,ti_may_be_in_reg);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1725,7 +1725,7 @@ implementation
|
|||||||
{ some conversions, like dynarray to pointer in Delphi
|
{ some conversions, like dynarray to pointer in Delphi
|
||||||
mode, must not be removed, because then we get memory
|
mode, must not be removed, because then we get memory
|
||||||
leaks due to missing temp finalization }
|
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
|
{ different kinds of refcounted types may need calls
|
||||||
to different kinds of refcounting helpers }
|
to different kinds of refcounting helpers }
|
||||||
(resultdef=left.resultdef)) then
|
(resultdef=left.resultdef)) then
|
||||||
|
@ -440,7 +440,7 @@ implementation
|
|||||||
Message(parser_e_no_local_para_def);
|
Message(parser_e_no_local_para_def);
|
||||||
consume(_OF);
|
consume(_OF);
|
||||||
single_type(t2,false,false);
|
single_type(t2,false,false);
|
||||||
if is_refcounted_type(t2) then
|
if is_managed_type(t2) then
|
||||||
Message(parser_e_no_refcounted_typed_file);
|
Message(parser_e_no_refcounted_typed_file);
|
||||||
def:=tfiledef.createtyped(t2);
|
def:=tfiledef.createtyped(t2);
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user