Commit graph

71 commits

Author SHA1 Message Date
Bill Currie
3e5989463f Update the def_tail when removing the last def from the space. 2011-02-14 23:10:45 +09:00
Bill Currie
c336aaeb80 Handle incomplete types gracefully. 2011-02-13 19:26:20 +09:00
Bill Currie
8c01497936 Give __obj_exec_class a sterner beating.
When linking a def into a defspace, ensure it can be removed. This fixes
the missing __obj_exec_class def in qwaq.
2011-02-11 22:29:57 +09:00
Bill Currie
0efc759f2d Catch attempts to create a def with a null type. 2011-02-11 22:29:57 +09:00
Bill Currie
c3a991e555 Support nil in initializers. 2011-02-10 14:51:52 +09:00
Bill Currie
01a7af17e5 Beat __obj_exec_class into submission. 2011-02-10 00:15:19 +09:00
Bill Currie
afc6605739 Don't set the space for external defs. 2011-01-29 09:55:14 +09:00
Bill Currie
f45919df09 Need alias defs after all. 2011-01-25 15:42:26 +09:00
Bill Currie
726f293d0d Allocate space for defs and handle basic initializations.
Block initializers (arrays and structs) are still broken.
2011-01-25 12:16:13 +09:00
Bill Currie
0624408317 Move the diagnostic functions into their own file. 2011-01-24 21:54:57 +09:00
Bill Currie
afc5b2827d Simplify def handling, use far data.
Since there is now a proper symbol table, defs are now just references to
memory locations and the symbol table takes care of duplicates.

Also, start using far data for ObjQC structures.

The qfo functions have been stubbed out until I figure out what to do with
object files in the new scheme.
2011-01-24 15:41:43 +09:00
Bill Currie
4a24393d8d Temp expressions now use operands instead of defs. 2011-01-21 11:26:43 +09:00
Bill Currie
ea3895805b Rewrite much to use symbols and symtabs. Gut emit.c. Massive breakage.
That which isn't rewritten is horribly broken. However, this does include a
nice mechanism for building QC structs for emitting data.

emit.c has been gutted in the spirit of "throw one away".

There is much work to be done to get even variables emitted, let alone
code. Things should be a little more fun from here on.
2011-01-17 22:34:41 +09:00
Bill Currie
85de101aa3 Break out the defspace code.
This also makes some improvements to the free block handling code.
2011-01-17 22:34:41 +09:00
Bill Currie
75ec6bf244 Clean out some unnecessary types from the progs engine and clean up the mess.
This is a nasty commit, sorry, but 99% of the commit is interdependent.
2011-01-10 12:25:31 +09:00
Bill Currie
fac98536f0 make sure def->space points to the space the def's location is allocated from to ensure that freeing the location works properly (fixes the bogus address triggered by prozaccoop: thanks, phrosty) 2010-02-22 13:11:41 +00:00
Bill Currie
d558444b77 make temp def problems a little easier to understand
o  set return_address whenever a temp def is requested, no only when it is
    actually created.
 o  make the notices about temp reference counting problems a little more
    readable and include the name of the temp
2010-01-13 06:24:29 +00:00
Bill Currie
680bc22697 better error reporting for redefines 2007-05-13 09:02:51 +00:00
Bill Currie
52d178b3be Add a code generation option, "local-merging", to control qfcc's merging of local variable blocks into one block. Defaults to on for advanced mode and off for traditional. 2007-04-10 13:00:21 +00:00
Bill Currie
0382b05780 various unsigned long -> uintptr_t conversions 2007-04-04 11:22:48 +00:00
Bill Currie
3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Bill Currie
116860bb66 don't segfault when running out of globals 2005-06-10 05:16:20 +00:00
Bill Currie
66257e3a88 run in fear, function overloading is here
This is an imperfect revision of history.
2004-11-13 11:50:00 +00:00
Bill Currie
50dc955652 fix a couple out-by-one errors highlighted by quaternions 2004-04-09 02:20:47 +00:00
Bill Currie
0360859a0f all warnings (except for @self and self) are now fully controllable 2004-02-17 00:39:21 +00:00
Bill Currie
bf592412f8 give temp defs a name, making it easier to read disassembly output (.tmpN) 2004-02-06 08:58:19 +00:00
Bill Currie
385a90e8fb correct pr_symtab_t to include the pointer to the array of selectors used
in the module. Unfortunatly, this requires a version bump on both qfo and
progs files due to the changes structure layout.
2003-08-23 06:15:19 +00:00
Bill Currie
6ecb707257 revamp the struct system so "struct foo;" does the right thing (ala C) 2003-07-30 04:11:45 +00:00
Bill Currie
378c477b8e setup vector fields properly 2003-07-23 18:40:09 +00:00
Bill Currie
778cd78c35 fix some namespace issues with names both being a field and an ivar 2003-07-23 18:28:31 +00:00
Bill Currie
b6b5089ccc add a "nosave" flag to defs making it easier to make defs that don't get
saved automaticly
2003-04-25 17:00:22 +00:00
Bill Currie
2f6fc5d80c general revamp so params and the return value use proper defs rather than
hardcoded locations. this will allow use of quaternions in the future.
2003-04-22 15:29:32 +00:00
Bill Currie
eb099ae0d3 make qf gcc 3.3 clean 2003-04-17 00:01:48 +00:00
Bill Currie
5a58c58e7a don't initialize external defs. this broke source line/file tracking for
@extern defs in headers.
2003-02-24 19:13:56 +00:00
Bill Currie
761a7546dd re-arrange things so __attribute__ and __builtin_expect are properly
autoconfiscated so rcsid will continue to work with gcc 3.3
2003-01-15 15:31:36 +00:00
Bill Currie
567b905590 copyright block work 2002-10-22 14:53:18 +00:00
Bill Currie
22d3cf9664 rename the def_void and dev_function defs 2002-10-09 19:17:45 +00:00
Bill Currie
a20bb946f6 type.[ch]:
provide a vector structure def so vector.[xyz] can be implemented
def.c:
	record the return address in get_temp to aid debugging
2002-10-08 22:35:37 +00:00
Bill Currie
f992090b18 don't do extra manipulations for unnamed defs 2002-10-08 18:03:23 +00:00
Bill Currie
412db7e27d "for example" is more appropriate than "that is" 2002-09-16 15:42:11 +00:00
Bill Currie
090e65bc09 mark allocated fields constant 2002-09-12 18:34:17 +00:00
Bill Currie
f6cdbdf63c make sure an initialized def has the correct source file and line info 2002-09-07 06:45:51 +00:00
Bill Currie
c927b2e834 quakefs.c:
allow . and .. in a path so long as the result doesn't escape from the
	game directory
cl_menu/Makefile.am:
	don't strip source paths
optoins.qc:
	use InputLine object
def.c:
	use notice to show stray temps
emit.c:
	make sure expression args get emitted for function calls
expr.c:
	'C' is a cast
	rewrite cast_expr to handle casted pointere derefs
2002-08-20 06:11:10 +00:00
Bill Currie
cab813c559 check the scope when checking for duplicate vector sub-defs 2002-08-16 16:51:00 +00:00
Bill Currie
0840678465 handle extern -> defined transition properly for vectors 2002-08-13 21:19:30 +00:00
Bill Currie
b0d568d85f local defs for debug info now work 2002-07-17 15:40:08 +00:00
Bill Currie
678a45cfe2 entity fields seem to work. I guess this means separate compilation is now
useful :)
2002-07-16 21:59:47 +00:00
Bill Currie
c36b7e36d2 fix external vectors and only complain about undefined externals that are
actually used
2002-07-16 20:09:14 +00:00
Bill Currie
3cf754db30 keep the return def out of .qfo files (for now, anyway) 2002-07-12 15:54:46 +00:00
Bill Currie
24d473c386 more linking fixes 2002-07-12 06:17:24 +00:00