mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-06 05:28:07 +02:00
* Flags specific to TDerefNode have been moved to their own field
This commit is contained in:
parent
179fc5848b
commit
4736cc2360
@ -160,7 +160,7 @@ implementation
|
||||
{$ifdef x86}
|
||||
(tcpupointerdef(left.resultdef).x86pointertyp = tcpupointerdefclass(cpointerdef).default_x86_data_pointer_type) and
|
||||
{$endif x86}
|
||||
not(nf_no_checkpointer in flags) and
|
||||
not(drnf_no_checkpointer in derefnodeflags) and
|
||||
{ can be NR_NO in case of LOC_CONSTANT }
|
||||
(location.reference.base<>NR_NO) then
|
||||
begin
|
||||
|
@ -298,7 +298,7 @@ implementation
|
||||
(cs_checkpointer in current_settings.localswitches) and
|
||||
not(cs_compilesystem in current_settings.moduleswitches) and
|
||||
tpointerdef(left.resultdef).compatible_with_pointerdef_size(tpointerdef(voidpointertype)) and
|
||||
not(nf_no_checkpointer in flags) and
|
||||
not(drnf_no_checkpointer in derefnodeflags) and
|
||||
{ can be NR_NO in case of LOC_CONSTANT }
|
||||
(location.reference.base<>NR_NO) then
|
||||
begin
|
||||
|
@ -1840,7 +1840,7 @@ implementation
|
||||
{ left is reused }
|
||||
left := nil;
|
||||
result := cderefnode.create(result);
|
||||
include(result.flags,nf_no_checkpointer);
|
||||
include(TDerefNode(result).derefnodeflags,drnf_no_checkpointer);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -103,11 +103,25 @@ interface
|
||||
end;
|
||||
taddrnodeclass = class of taddrnode;
|
||||
|
||||
TDerefNodeFlag =
|
||||
(
|
||||
drnf_no_checkpointer
|
||||
);
|
||||
|
||||
TDerefNodeFlags = set of TDerefNodeFlag;
|
||||
|
||||
tderefnode = class(tunarynode)
|
||||
derefnodeflags: TDerefNodeFlags;
|
||||
constructor create(l : tnode);virtual;
|
||||
constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
|
||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||
function dogetcopy : tnode;override;
|
||||
function pass_1 : tnode;override;
|
||||
function pass_typecheck:tnode;override;
|
||||
procedure mark_write;override;
|
||||
{$ifdef DEBUG_NODE_XML}
|
||||
procedure XMLPrintNodeInfo(var T: Text);
|
||||
{$endif DEBUG_NODE_XML}
|
||||
end;
|
||||
tderefnodeclass = class of tderefnode;
|
||||
|
||||
@ -850,6 +864,30 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
constructor tderefnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
|
||||
begin
|
||||
inherited ppuload(t, ppufile);
|
||||
ppufile.getset(tppuset1(derefnodeflags));
|
||||
end;
|
||||
|
||||
|
||||
procedure tderefnode.ppuwrite(ppufile:tcompilerppufile);
|
||||
begin
|
||||
inherited ppuwrite(ppufile);
|
||||
ppufile.putset(tppuset1(derefnodeflags));
|
||||
end;
|
||||
|
||||
|
||||
function tderefnode.dogetcopy : tnode;
|
||||
var
|
||||
n: TDerefNode;
|
||||
begin
|
||||
n := TDerefNode(inherited dogetcopy);
|
||||
n.derefnodeflags := derefnodeflags;
|
||||
Result := n;
|
||||
end;
|
||||
|
||||
|
||||
function tderefnode.pass_typecheck:tnode;
|
||||
begin
|
||||
result:=nil;
|
||||
@ -885,6 +923,28 @@ implementation
|
||||
expectloc:=LOC_REFERENCE;
|
||||
end;
|
||||
|
||||
{$ifdef DEBUG_NODE_XML}
|
||||
procedure TDerefNode.XMLPrintNodeInfo(var T: Text);
|
||||
var
|
||||
i: TDerefNodeFlag;
|
||||
First: Boolean;
|
||||
begin
|
||||
inherited XMLPrintNodeInfo(T);
|
||||
First := True;
|
||||
for i in derefnodeflags do
|
||||
begin
|
||||
if First then
|
||||
begin
|
||||
Write(T, ' derefnodeflags="', i);
|
||||
First := False;
|
||||
end
|
||||
else
|
||||
Write(T, ',', i)
|
||||
end;
|
||||
if not First then
|
||||
Write(T, '"');
|
||||
end;
|
||||
{$endif DEBUG_NODE_XML}
|
||||
|
||||
{*****************************************************************************
|
||||
TSUBSCRIPTNODE
|
||||
|
@ -233,9 +233,6 @@ interface
|
||||
in the case of pure assembly routines }
|
||||
nf_usercode_entry,
|
||||
|
||||
{ tderefnode }
|
||||
nf_no_checkpointer,
|
||||
|
||||
{ tloadnode/ttypeconvnode }
|
||||
nf_absolute,
|
||||
|
||||
|
@ -277,7 +277,7 @@ implementation
|
||||
if is_new then
|
||||
begin
|
||||
p2:=cderefnode.create(p.getcopy);
|
||||
include(p2.flags,nf_no_checkpointer);
|
||||
include(TDerefNode(p2).derefnodeflags,drnf_no_checkpointer);
|
||||
end
|
||||
else
|
||||
p2:=cderefnode.create(p);
|
||||
|
Loading…
Reference in New Issue
Block a user