Index: m3-sys/m3back/src/M3x86.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3back/src/M3x86.m3,v retrieving revision 1.182 diff -u -r1.182 M3x86.m3 --- m3-sys/m3back/src/M3x86.m3 6 Jul 2010 20:58:45 -0000 1.182 +++ m3-sys/m3back/src/M3x86.m3 27 Aug 2010 10:33:36 -0000 @@ -3847,7 +3847,7 @@ END load_stack_param; -PROCEDURE pop_struct (u: U; s: ByteSize; a: Alignment) = +PROCEDURE pop_struct (u: U; type: TypeUID; s: ByteSize; a: Alignment) = (* pop s0 and make it the "next" parameter in the current call * NOTE that we implement call by value, the struct is * copied to temporary space on the machine stack @@ -3856,6 +3856,7 @@ BEGIN IF u.debug THEN u.wr.Cmd ("pop_struct"); + u.wr.Tipe (type); u.wr.Int (s); u.wr.Int (a); u.wr.NL (); Index: m3-sys/m3cc/gcc/gcc/m3cg/parse.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc/gcc/m3cg/parse.c,v retrieving revision 1.259 diff -u -r1.259 parse.c --- m3-sys/m3cc/gcc/gcc/m3cg/parse.c 27 Aug 2010 10:32:39 -0000 1.259 +++ m3-sys/m3cc/gcc/gcc/m3cg/parse.c 27 Aug 2010 10:33:37 -0000 @@ -3401,18 +3401,7 @@ fprintf(stderr, " param %s type:%s typeid:0x%lx bytesize:0x%lx alignment:0x%lx in_memory:0x%x up_level:0x%x\n", IDENTIFIER_POINTER(DECL_NAME(v)), m3cg_typename(t), id, s, a, in_memory, up_level); -#if 0 -/* Using m3_build_type_id causes problems. This needs further attention. - These are the files to look into: - caltech-parser/parserlib/klexlib/AMD64_DARWIN/RegExpParse.ms - m3-libs/libm3/AMD64_DARWIN/Pickle2.ms - m3-tools/showheap/AMD64_DARWIN/ShowHeap.ms - m3-ui/vbtkit/AMD64_DARWIN/VTReal.ms -*/ TREE_TYPE (v) = m3_build_type_id (t, s, a, id); -#else - TREE_TYPE (v) = m3_build_type (t, s, a); -#endif DECL_NONLOCAL (v) = up_level || in_memory; TREE_ADDRESSABLE (v) = in_memory; DECL_ARG_TYPE (v) = TREE_TYPE (v); @@ -5320,10 +5309,11 @@ static void m3cg_pop_struct (void) { + TYPEID (my_id); BYTESIZE (s); ALIGNMENT (a); - tree t = m3_build_type (T_struct, s, a); + tree t = m3_build_type_id (T_struct, s, a, my_id); if (option_vars_trace) fprintf(stderr, " pop struct size:0x%lx alignment:0x%lx\n", s, a); Index: m3-sys/m3front/src/misc/CG.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3front/src/misc/CG.m3,v retrieving revision 1.37 diff -u -r1.37 CG.m3 --- m3-sys/m3front/src/misc/CG.m3 28 Jun 2010 01:30:29 -0000 1.37 +++ m3-sys/m3front/src/misc/CG.m3 27 Aug 2010 10:33:37 -0000 @@ -2536,10 +2536,10 @@ SEmpty ("Pop_param"); END Pop_param; -PROCEDURE Pop_struct (s: Size; a: Alignment) = +PROCEDURE Pop_struct (t: TypeUID; s: Size; a: Alignment) = BEGIN Force (); - cg.pop_struct (ToBytes (s), FixAlign (a)); + cg.pop_struct (t, ToBytes (s), FixAlign (a)); SPop (1, "Pop_struct"); SEmpty ("Pop_struct"); END Pop_struct; Index: m3-sys/m3front/src/values/Formal.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3front/src/values/Formal.m3,v retrieving revision 1.12 diff -u -r1.12 Formal.m3 --- m3-sys/m3front/src/values/Formal.m3 30 Jan 2010 22:11:31 -0000 1.12 +++ m3-sys/m3front/src/values/Formal.m3 27 Aug 2010 10:33:37 -0000 @@ -469,7 +469,7 @@ CG.Pop_param (CG.Type.Addr) ELSIF (is_struct) THEN EVAL Type.CheckInfo (t.tipe, info); - CG.Pop_struct (info.size, info.alignment); + CG.Pop_struct (Type.GlobalUID (t.tipe), info.size, info.alignment); ELSE (* by-value scalar *) CG.Pop_param (Type.CGType (t.tipe, in_memory := TRUE)); END; Index: m3-sys/m3middle/src/M3CG.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG.m3,v retrieving revision 1.6 diff -u -r1.6 M3CG.m3 --- m3-sys/m3middle/src/M3CG.m3 11 Mar 2010 05:42:03 -0000 1.6 +++ m3-sys/m3middle/src/M3CG.m3 27 Aug 2010 10:33:37 -0000 @@ -874,9 +874,9 @@ xx.child.pop_param (t); END pop_param; -PROCEDURE pop_struct (xx: T; s: ByteSize; a: Alignment) = +PROCEDURE pop_struct (xx: T; t: TypeUID; s: ByteSize; a: Alignment) = BEGIN - xx.child.pop_struct (s, a); + xx.child.pop_struct (t, s, a); END pop_struct; PROCEDURE pop_static_link (xx: T) = Index: m3-sys/m3middle/src/M3CG_BinRd.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_BinRd.m3,v retrieving revision 1.11 diff -u -r1.11 M3CG_BinRd.m3 --- m3-sys/m3middle/src/M3CG_BinRd.m3 12 Mar 2010 11:07:36 -0000 1.11 +++ m3-sys/m3middle/src/M3CG_BinRd.m3 27 Aug 2010 10:33:37 -0000 @@ -1584,10 +1584,11 @@ END pop_param; PROCEDURE pop_struct (VAR s: State) = - VAR size := Scan_int (s); + VAR type := Scan_tipe (s); + size := Scan_int (s); align := Scan_int (s); BEGIN - s.cg.pop_struct (size, align); + s.cg.pop_struct (type, size, align); END pop_struct; PROCEDURE pop_static_link (VAR s: State) = Index: m3-sys/m3middle/src/M3CG_BinWr.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_BinWr.m3,v retrieving revision 1.14 diff -u -r1.14 M3CG_BinWr.m3 --- m3-sys/m3middle/src/M3CG_BinWr.m3 11 Mar 2010 05:42:04 -0000 1.14 +++ m3-sys/m3middle/src/M3CG_BinWr.m3 27 Aug 2010 10:33:38 -0000 @@ -1547,10 +1547,11 @@ TName (u, t); END pop_param; -PROCEDURE pop_struct (u: U; s: ByteSize; a: Alignment) = +PROCEDURE pop_struct (u: U; t: TypeUID; s: ByteSize; a: Alignment) = (* pop s0 and make it the "next" paramter in the current call *) BEGIN Cmd (u, Bop.pop_struct); + Tipe (u, t); Int (u, s); Int (u, a); END pop_struct; Index: m3-sys/m3middle/src/M3CG_Check.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Check.m3,v retrieving revision 1.10 diff -u -r1.10 M3CG_Check.m3 --- m3-sys/m3middle/src/M3CG_Check.m3 16 Apr 2010 10:38:07 -0000 1.10 +++ m3-sys/m3middle/src/M3CG_Check.m3 27 Aug 2010 10:33:38 -0000 @@ -14,7 +14,7 @@ FROM M3CG IMPORT ByteSize, Alignment, Frequency, RuntimeError; FROM M3CG IMPORT Var, Proc, Label, Sign, CompareOp, ConvertOp, AtomicOp; FROM M3CG IMPORT Type, ZType, AType, RType, IType, MType; -FROM M3CG IMPORT MemoryOrder; +FROM M3CG IMPORT MemoryOrder, TypeUID; TYPE (* stack data types *) ST = { Addr, Int32, Int64, Reel, LReel, XReel, Void, @@ -1254,13 +1254,13 @@ self.child.pop_param (t); END pop_param; -PROCEDURE pop_struct (self: U; s: ByteSize; a: Alignment) = +PROCEDURE pop_struct (self: U; t: TypeUID; s: ByteSize; a: Alignment) = (* pop s0 and make it the "next" parameter in the current call *) BEGIN IF (self.call_count <= 0) THEN PutErr (self, "missing start_call") END; self.s_pop (ST.Addr); IF (self.clean_stores) THEN self.s_empty () END; - self.child.pop_struct (s, a); + self.child.pop_struct (t, s, a); END pop_struct; PROCEDURE pop_static_link (self: U) = Index: m3-sys/m3middle/src/M3CG_Ops.i3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Ops.i3,v retrieving revision 1.8 diff -u -r1.8 M3CG_Ops.i3 --- m3-sys/m3middle/src/M3CG_Ops.i3 11 Mar 2010 05:42:04 -0000 1.8 +++ m3-sys/m3middle/src/M3CG_Ops.i3 27 Aug 2010 10:33:38 -0000 @@ -589,7 +589,7 @@ pop_param (t: MType); (* pop s0.t and make it the "next" parameter in the current call. *) -pop_struct (s: ByteSize; a: Alignment); +pop_struct (t: TypeUID; s: ByteSize; a: Alignment); (* pop s0.A, it's a pointer to a structure occupying 's' bytes that's 'a' byte aligned; pass the structure by value as the "next" parameter in the current call. *) Index: m3-sys/m3middle/src/M3CG_Rd.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Rd.m3,v retrieving revision 1.9 diff -u -r1.9 M3CG_Rd.m3 --- m3-sys/m3middle/src/M3CG_Rd.m3 12 Mar 2010 11:14:58 -0000 1.9 +++ m3-sys/m3middle/src/M3CG_Rd.m3 27 Aug 2010 10:33:38 -0000 @@ -1709,10 +1709,11 @@ END pop_param; PROCEDURE pop_struct (VAR s: State) = - VAR size := Scan_int (s); + VAR type := Scan_tipe (s); + size := Scan_int (s); align := Scan_int (s); BEGIN - s.cg.pop_struct (size, align); + s.cg.pop_struct (type, size, align); END pop_struct; PROCEDURE pop_static_link (VAR s: State) = Index: m3-sys/m3middle/src/M3CG_Wr.m3 =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3middle/src/M3CG_Wr.m3,v retrieving revision 1.12 diff -u -r1.12 M3CG_Wr.m3 --- m3-sys/m3middle/src/M3CG_Wr.m3 12 Mar 2010 11:07:36 -0000 1.12 +++ m3-sys/m3middle/src/M3CG_Wr.m3 27 Aug 2010 10:33:38 -0000 @@ -1670,10 +1670,11 @@ NL (u); END pop_param; -PROCEDURE pop_struct (u: U; s: ByteSize; a: Alignment) = +PROCEDURE pop_struct (u: U; t: TypeUID; s: ByteSize; a: Alignment) = (* pop s0 and make it the "next" paramter in the current call *) BEGIN Cmd (u, "pop_struct"); + Tipe (u, t); Int (u, s); Int (u, a); NL (u);