From 37732325f3985dae30844b36d0bdfe0b5f882727 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 5 Nov 1998 14:26:47 +0000 Subject: [PATCH] * fixed variant warning with was sometimes said with sets --- compiler/pass_1.pas | 7 +++++-- compiler/tcld.pas | 36 +++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/compiler/pass_1.pas b/compiler/pass_1.pas index 4fd21299f5..a42668b2f8 100644 --- a/compiler/pass_1.pas +++ b/compiler/pass_1.pas @@ -270,7 +270,7 @@ implementation firstadd, {starstarn} firstprocinline, {procinlinen} firstarrayconstruct, {arrayconstructn} - firstnothing, {arrayconstructrangen} + firstarrayconstructrange, {arrayconstructrangen} firstnothing, {nothingn} firstloadvmt {loadvmtn} ); @@ -350,7 +350,10 @@ implementation end. { $Log$ - Revision 1.96 1998-10-06 20:49:07 peter + Revision 1.97 1998-11-05 14:26:47 peter + * fixed variant warning with was sometimes said with sets + + Revision 1.96 1998/10/06 20:49:07 peter * m68k compiler compiles again Revision 1.95 1998/09/24 15:13:44 peter diff --git a/compiler/tcld.pas b/compiler/tcld.pas index 669f8d8fb5..8d0907bada 100644 --- a/compiler/tcld.pas +++ b/compiler/tcld.pas @@ -29,6 +29,7 @@ interface procedure firstload(var p : ptree); procedure firstassignment(var p : ptree); procedure firstfuncret(var p : ptree); + procedure firstarrayconstructrange(var p:ptree); procedure firstarrayconstruct(var p : ptree); procedure firsttype(var p : ptree); @@ -319,6 +320,19 @@ implementation end; +{***************************************************************************** + FirstArrayConstructRange +*****************************************************************************} + + procedure firstarrayconstructrange(var p:ptree); + begin + firstpass(p^.left); + firstpass(p^.right); + calcregisters(p,0,0,0); + p^.resulttype:=p^.left^.resulttype; + end; + + {***************************************************************************** FirstArrayConstruct *****************************************************************************} @@ -357,10 +371,7 @@ implementation pd:=hp^.left^.resulttype else if (not varia) and (not is_equal(pd,hp^.left^.resulttype)) then - begin - varia:=true; - Comment(V_Warning,'Variant type found !!'); - end; + varia:=true; inc(len); hp:=hp^.right; end; @@ -373,18 +384,6 @@ implementation end; -{***************************************************************************** - FirstArrayConstructRange -*****************************************************************************} - - procedure firstarrayconstructrange(var p : ptree); - begin - { This is not allowed, it's only to support sets when parsing the [a..b] } - Internalerror(4236); - Codegenerror:=true; - end; - - {***************************************************************************** Type *****************************************************************************} @@ -399,7 +398,10 @@ implementation end. { $Log$ - Revision 1.6 1998-10-19 08:55:12 pierre + Revision 1.7 1998-11-05 14:26:48 peter + * fixed variant warning with was sometimes said with sets + + Revision 1.6 1998/10/19 08:55:12 pierre * wrong stabs info corrected once again !! + variable vmt offset with vmt field only if required implemented now !!!