mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-06 19:38:33 +02:00
* moved the pass_1 handling of vecnodes for arraydefs to a new virtual method
tvecnode.first_arraydef. This will allow overriding it in the i8086 code generator in order to handle huge arrays. git-svn-id: trunk@28271 -
This commit is contained in:
parent
36d63b953e
commit
235a37fad4
@ -106,6 +106,9 @@ interface
|
|||||||
tsubscriptnodeclass = class of tsubscriptnode;
|
tsubscriptnodeclass = class of tsubscriptnode;
|
||||||
|
|
||||||
tvecnode = class(tbinarynode)
|
tvecnode = class(tbinarynode)
|
||||||
|
protected
|
||||||
|
function first_arraydef: tnode; virtual;
|
||||||
|
public
|
||||||
constructor create(l,r : tnode);virtual;
|
constructor create(l,r : tnode);virtual;
|
||||||
function pass_1 : tnode;override;
|
function pass_1 : tnode;override;
|
||||||
function pass_typecheck:tnode;override;
|
function pass_typecheck:tnode;override;
|
||||||
@ -1106,17 +1109,32 @@ implementation
|
|||||||
tcallnode.gen_high_tree }
|
tcallnode.gen_high_tree }
|
||||||
if (right.nodetype=rangen) then
|
if (right.nodetype=rangen) then
|
||||||
CGMessagePos(right.fileinfo,parser_e_illegal_expression)
|
CGMessagePos(right.fileinfo,parser_e_illegal_expression)
|
||||||
else if (not is_packed_array(left.resultdef)) or
|
else if left.resultdef.typ=arraydef then
|
||||||
((tarraydef(left.resultdef).elepackedbitsize mod 8) = 0) then
|
result:=first_arraydef
|
||||||
if left.expectloc=LOC_CREFERENCE then
|
|
||||||
expectloc:=LOC_CREFERENCE
|
|
||||||
else
|
|
||||||
expectloc:=LOC_REFERENCE
|
|
||||||
else
|
else
|
||||||
if left.expectloc=LOC_CREFERENCE then
|
begin
|
||||||
expectloc:=LOC_CSUBSETREF
|
if left.expectloc=LOC_CREFERENCE then
|
||||||
else
|
expectloc:=LOC_CREFERENCE
|
||||||
expectloc:=LOC_SUBSETREF;
|
else
|
||||||
|
expectloc:=LOC_REFERENCE
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tvecnode.first_arraydef: tnode;
|
||||||
|
begin
|
||||||
|
result:=nil;
|
||||||
|
if (not is_packed_array(left.resultdef)) or
|
||||||
|
((tarraydef(left.resultdef).elepackedbitsize mod 8) = 0) then
|
||||||
|
if left.expectloc=LOC_CREFERENCE then
|
||||||
|
expectloc:=LOC_CREFERENCE
|
||||||
|
else
|
||||||
|
expectloc:=LOC_REFERENCE
|
||||||
|
else
|
||||||
|
if left.expectloc=LOC_CREFERENCE then
|
||||||
|
expectloc:=LOC_CSUBSETREF
|
||||||
|
else
|
||||||
|
expectloc:=LOC_SUBSETREF;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user