mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 21:02:09 +02:00
+ some simplify support for ttypeconvnode
git-svn-id: trunk@2774 -
This commit is contained in:
parent
785550d7e3
commit
5fbc345674
@ -48,6 +48,7 @@ interface
|
|||||||
procedure printnodeinfo(var t : text);override;
|
procedure printnodeinfo(var t : text);override;
|
||||||
function pass_1 : tnode;override;
|
function pass_1 : tnode;override;
|
||||||
function det_resulttype:tnode;override;
|
function det_resulttype:tnode;override;
|
||||||
|
function simplify:tnode; override;
|
||||||
procedure mark_write;override;
|
procedure mark_write;override;
|
||||||
function docompare(p: tnode) : boolean; override;
|
function docompare(p: tnode) : boolean; override;
|
||||||
function assign_allowed:boolean;
|
function assign_allowed:boolean;
|
||||||
@ -1634,6 +1635,20 @@ implementation
|
|||||||
CGMessage(type_w_pointer_to_longint_conv_not_portable);
|
CGMessage(type_w_pointer_to_longint_conv_not_portable);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
result := simplify;
|
||||||
|
if assigned(result) then
|
||||||
|
exit;
|
||||||
|
|
||||||
|
{ now call the resulttype helper to do constant folding }
|
||||||
|
result:=resulttype_call_helper(convtype);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function ttypeconvnode.simplify: tnode;
|
||||||
|
var
|
||||||
|
hp: tnode;
|
||||||
|
begin
|
||||||
|
result := nil;
|
||||||
{ Constant folding and other node transitions to
|
{ Constant folding and other node transitions to
|
||||||
remove the typeconv node }
|
remove the typeconv node }
|
||||||
case left.nodetype of
|
case left.nodetype of
|
||||||
@ -1714,11 +1729,9 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ now call the resulttype helper to do constant folding }
|
|
||||||
result:=resulttype_call_helper(convtype);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure Ttypeconvnode.mark_write;
|
procedure Ttypeconvnode.mark_write;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user