mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 23:21:57 +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;
|
||||
function pass_1 : tnode;override;
|
||||
function det_resulttype:tnode;override;
|
||||
function simplify:tnode; override;
|
||||
procedure mark_write;override;
|
||||
function docompare(p: tnode) : boolean; override;
|
||||
function assign_allowed:boolean;
|
||||
@ -1634,6 +1635,20 @@ implementation
|
||||
CGMessage(type_w_pointer_to_longint_conv_not_portable);
|
||||
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
|
||||
remove the typeconv node }
|
||||
case left.nodetype of
|
||||
@ -1714,11 +1729,9 @@ implementation
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ now call the resulttype helper to do constant folding }
|
||||
result:=resulttype_call_helper(convtype);
|
||||
end;
|
||||
|
||||
|
||||
procedure Ttypeconvnode.mark_write;
|
||||
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user