ccom.git
7 years agoAdd tests, fixes for tests, reinstate and type-convert stuff marked "bitrot" master origin/master
Nick Downing [Mon, 20 Feb 2017 14:19:56 +0000 (01:19 +1100)]
Add tests, fixes for tests, reinstate and type-convert stuff marked "bitrot"

7 years agoReplace getype()/getail() stuff with a modified version of the original getype()...
Nick Downing [Sun, 19 Feb 2017 05:18:06 +0000 (16:18 +1100)]
Replace getype()/getail() stuff with a modified version of the original getype() which constructs the type as a linked list, keeping track of the tail so that it can build onto the inner type as things are parsed, this fixes a bug where (*name)() was interpreted as FUNC,PTR rather than PTR,FUNC, and makes arrays easier

7 years agoReinstate enum handling, removed since I was confused about a misplaced nl_strp
Nick Downing [Thu, 16 Feb 2017 04:41:27 +0000 (15:41 +1100)]
Reinstate enum handling, removed since I was confused about a misplaced nl_strp

7 years agoRemove old types from struct nmlist altogether, just convert to old type when copying...
Nick Downing [Thu, 16 Feb 2017 03:01:42 +0000 (14:01 +1100)]
Remove old types from struct nmlist altogether, just convert to old type when copying type to expression node (this highlighted many unconverted spots in parser)

7 years agoImplement a new struct btype (inherits from struct type) with id BITFLD, to contain...
Nick Downing [Wed, 15 Feb 2017 14:07:05 +0000 (01:07 +1100)]
Implement a new struct btype (inherits from struct type) with id BITFLD, to contain the struct FS (field specification, i.e. flen and bitoffs), in a similar way to how struct stype (inherits from struct type) with id STRUCT contains the struct SS, replace the nl_flags&FFIELD test with a new nl_dtype->t_id==BITFLD test

7 years agoRationalize type compatibility checks to fix a potential problem where new dtype...
Nick Downing [Wed, 15 Feb 2017 13:36:39 +0000 (00:36 +1100)]
Rationalize type compatibility checks to fix a potential problem where new dtype was clobbering old dtype even though dimension info was merged into old dtype

7 years agoChange ptype to rtype, make new REF basic type ORed with PTR, FUNC or ARRAY
Nick Downing [Wed, 15 Feb 2017 09:50:09 +0000 (20:50 +1100)]
Change ptype to rtype, make new REF basic type ORed with PTR, FUNC or ARRAY

7 years agoMake declarator parsing use only detailed types (just fill in old type at end)
Nick Downing [Wed, 15 Feb 2017 09:19:24 +0000 (20:19 +1100)]
Make declarator parsing use only detailed types (just fill in old type at end)

7 years agoTidy up types representation, combining pt_ptotype, ft_rettype, at_elttype into pt_re...
Nick Downing [Tue, 14 Feb 2017 07:29:46 +0000 (18:29 +1100)]
Tidy up types representation, combining pt_ptotype, ft_rettype, at_elttype into pt_reftype, by making struct ftype and struct atype inherit from struct ptype

7 years agoMake declarator and type parser output detailed types, in addition to old style
Nick Downing [Mon, 13 Feb 2017 15:32:07 +0000 (02:32 +1100)]
Make declarator and type parser output detailed types, in addition to old style

7 years agoChange structure tags in struct nmlist to be prefixed by nl_
Nick Downing [Sun, 12 Feb 2017 05:31:09 +0000 (16:31 +1100)]
Change structure tags in struct nmlist to be prefixed by nl_

7 years agoImplement locnnode (former nnode) and extnnode (former xnode) inheriting from a commo...
Nick Downing [Sun, 12 Feb 2017 05:23:13 +0000 (16:23 +1100)]
Implement locnnode (former nnode) and extnnode (former xnode) inheriting from a common base nnode, make fnode inherit from cnode, make fasgn inherit from tnode

7 years agoAdd type safety by changing union tree to struct tree which does not have access...
Nick Downing [Sat, 11 Feb 2017 13:34:37 +0000 (00:34 +1100)]
Add type safety by changing union tree to struct tree which does not have access to extended fields, and requires a dynamic cast before they are accessed

7 years agoChange c1 nomenclature, struct tname|xtname|tconst|lconst|ftconst, to simpler and...
Nick Downing [Sat, 11 Feb 2017 02:15:43 +0000 (13:15 +1100)]
Change c1 nomenclature, struct tname|xtname|tconst|lconst|ftconst, to simpler and more regular c0-style nomenclature, struct nnode|xnode|cnode|lnode|fnode

7 years agoFix over-enthusiastic uniqification (adding 0|1 to symbols that didn't need it)
Nick Downing [Sat, 11 Feb 2017 02:13:07 +0000 (13:13 +1100)]
Fix over-enthusiastic uniqification (adding 0|1 to symbols that didn't need it)

7 years agoFix bitfield selection operators to use c0 version of tree
Nick Downing [Fri, 10 Feb 2017 15:37:28 +0000 (02:37 +1100)]
Fix bitfield selection operators to use c0 version of tree

7 years agoFix STRASG issue (might need further attention), fix float and string literals
Nick Downing [Fri, 10 Feb 2017 13:36:08 +0000 (00:36 +1100)]
Fix STRASG issue (might need further attention), fix float and string literals

7 years agoSTAUTO bugfix to reinstate correct automatic variable storage allocation
Nick Downing [Fri, 10 Feb 2017 11:47:48 +0000 (22:47 +1100)]
STAUTO bugfix to reinstate correct automatic variable storage allocation

7 years agoMake cbranch0() route into cbranch1(), doesn't add STRASG node yet, need to fix
Nick Downing [Fri, 10 Feb 2017 10:55:14 +0000 (21:55 +1100)]
Make cbranch0() route into cbranch1(), doesn't add STRASG node yet, need to fix

7 years agoMake rcexpr0() route into rcexpr1(), doesn't add STRASG node yet, need to fix
Nick Downing [Fri, 10 Feb 2017 10:41:03 +0000 (21:41 +1100)]
Make rcexpr0() route into rcexpr1(), doesn't add STRASG node yet, need to fix

7 years agoMake c0 allocate augmented struct (x)tname instead of struct tnode in nblock()
Nick Downing [Fri, 10 Feb 2017 10:09:41 +0000 (21:09 +1100)]
Make c0 allocate augmented struct (x)tname instead of struct tnode in nblock()

7 years agoActually unify union tree0 with union tree1, move tree definitions into ccom.h
Nick Downing [Fri, 10 Feb 2017 09:34:04 +0000 (20:34 +1100)]
Actually unify union tree0 with union tree1, move tree definitions into ccom.h

7 years agoStart to unify union tree0 with union tree1 (change cnode to tconst0 and so on)
Nick Downing [Fri, 10 Feb 2017 09:08:09 +0000 (20:08 +1100)]
Start to unify union tree0 with union tree1 (change cnode to tconst0 and so on)

7 years agoMake proper one-pass compiler by redirecting c0 outcode() into c1 getree()
Nick Downing [Thu, 9 Feb 2017 15:29:05 +0000 (02:29 +1100)]
Make proper one-pass compiler by redirecting c0 outcode() into c1 getree()

7 years agoPut explicit starttree() and endtree() around all calls to rcexpr0() in c0 part
Nick Downing [Thu, 9 Feb 2017 14:07:55 +0000 (01:07 +1100)]
Put explicit starttree() and endtree() around all calls to rcexpr0() in c0 part

7 years agoCreated new driver ccom.c which creates its own tempfiles and runs both passes
Nick Downing [Tue, 7 Feb 2017 13:34:05 +0000 (00:34 +1100)]
Created new driver ccom.c which creates its own tempfiles and runs both passes

7 years agoUniqify all conflicting declarations in c[01], merge common stuff in new ccom.h
Nick Downing [Tue, 7 Feb 2017 12:54:55 +0000 (23:54 +1100)]
Uniqify all conflicting declarations in c[01], merge common stuff in new ccom.h

7 years agoC compiler from 211bsd.git commit 98921db
Nick Downing [Tue, 7 Feb 2017 11:41:49 +0000 (22:41 +1100)]
C compiler from 211bsd.git commit 98921db