summaryrefslogtreecommitdiff
path: root/compiler/nmem.pas
diff options
context:
space:
mode:
authornickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2014-07-26 16:18:57 +0000
committernickysn <nickysn@3ad0048d-3df7-0310-abae-a5850022a9f2>2014-07-26 16:18:57 +0000
commit8cf224a611dd4909d9bc0ba7289635f07483a02e (patch)
tree26d6b430fe45298ea74917ea80758531b2dac925 /compiler/nmem.pas
parent9afa6417be27afe3b2c59c38ec3c54ca2766be56 (diff)
downloadfpc-8cf224a611dd4909d9bc0ba7289635f07483a02e.tar.gz
* 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: http://svn.freepascal.org/svn/fpc/trunk@28271 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/nmem.pas')
-rw-r--r--compiler/nmem.pas38
1 files changed, 28 insertions, 10 deletions
diff --git a/compiler/nmem.pas b/compiler/nmem.pas
index 0696a0670e..c629119ceb 100644
--- a/compiler/nmem.pas
+++ b/compiler/nmem.pas
@@ -106,6 +106,9 @@ interface
tsubscriptnodeclass = class of tsubscriptnode;
tvecnode = class(tbinarynode)
+ protected
+ function first_arraydef: tnode; virtual;
+ public
constructor create(l,r : tnode);virtual;
function pass_1 : tnode;override;
function pass_typecheck:tnode;override;
@@ -1106,17 +1109,32 @@ implementation
tcallnode.gen_high_tree }
if (right.nodetype=rangen) then
CGMessagePos(right.fileinfo,parser_e_illegal_expression)
- else 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.resultdef.typ=arraydef then
+ result:=first_arraydef
else
- if left.expectloc=LOC_CREFERENCE then
- expectloc:=LOC_CSUBSETREF
- else
- expectloc:=LOC_SUBSETREF;
+ begin
+ if left.expectloc=LOC_CREFERENCE then
+ expectloc:=LOC_CREFERENCE
+ 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;