Commit graph

199 commits

Author SHA1 Message Date
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
4ac80c2932 Get qfcc running again.
It segs when it tries to link, but that's because a real object file has
not been created yet. However, I can get my tree and flow diagrams :)
2011-01-22 15:52:57 +09:00
Bill Currie
5deda9c9b9 Clean out ex_def as ex_symbol replaces it. 2011-01-19 22:25:04 +09:00
Bill Currie
b5424bca7d Start work on getting expressions converted to internal statements. 2011-01-19 15:47:45 +09:00
Bill Currie
e08efe036b Move the constant expression values into their own struct. 2011-01-19 08:43:24 +09:00
Bill Currie
87ce9f5333 Get basic function creation working.
Even more FIXMEs, but the pascal parser can now create functions. The
function records even get emitted.
2011-01-18 12:47:13 +09:00
Bill Currie
21c0c960ae Initialize data before types.
This is needed for string data. It might be better to init saved strings
separately, but this works for now.
2011-01-18 08:58: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
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
a09f02db1a Break out the debug and string functions from qc-lex.l. 2011-01-10 12:25:30 +09:00
Bill Currie
ac88c86dd3 Scripts now treat {}()': as single character tokens. 2010-11-28 15:31:30 +09:00
Bill Currie
c542138300 more not-really initialized data 2009-12-20 11:54:19 +00:00
Bill Currie
ac99aaf0d3 use "#line N file" instead of "# N file" (seems to be more portable) 2007-09-16 07:03:12 +00:00
Bill Currie
3431fea56d Make sure initialized locals that are treated as constants don't get relocated. Fixes the airfist bug in prozac 2007-09-15 07:58:39 +00:00
Bill Currie
01b71c40d2 fix some issues when using --advanced with v6only 2007-09-15 07:44:31 +00:00
Bill Currie
79fdf8db80 allow .imm symbols to be written in traditional mode 2007-05-15 07:25:47 +00:00
Bill Currie
a376e6f86d make control of progdefs.h generation saner 2007-04-28 05:40:22 +00:00
Bill Currie
93ee2e489b more vc2005 patches from phrosty 2007-04-11 22:03:36 +00:00
Bill Currie
992aa04994 Forgot to coorect the adjustment of the def's offset (yet I knew I was supposed to :P) 2007-04-10 14:03:34 +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
2399e79ca0 open all files in binary mode. ^Z is evil :P 2007-04-07 10:24:34 +00:00
Bill Currie
3f3450df2c fix a wrong name 2007-04-06 14:13:25 +00:00
Bill Currie
240eab4b09 cleanup the tempfile from a failed preprocessor run on progs.src 2007-04-06 09:44:08 +00:00
Bill Currie
90129fc4ec add $frame_reset grab command to reset the frame macro counter and sneak the command in before each file in the single-cpp script. This fixes the bogus animations in nq (and anything else, for that matter) 2007-03-31 13:54:09 +00:00
Bill Currie
1925bef0c1 fix a bunch of bugs with single-cpp processing when not keeping temps 2006-08-20 06:20:30 +00:00
Bill Currie
130e6c1a3f fix some intermediate file issues 2006-05-24 14:50:24 +00:00
Bill Currie
f7df6fea17 instead of having cpp args in progs.src, potentially breaking some mods, generate progs.i as a series of #includes and then compile everything in one pass 2006-05-24 14:35:39 +00:00
Bill Currie
ff28197da6 pass progs.src through cpp too 2006-05-24 11:19: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
ae456dc3a4 `secret' .c support so automake's dependency style autodetection works
This is an imperfect revision of history.
2004-11-14 23:15:00 +00:00
Bill Currie
4d044bfea4 make entity.vector.x work properly by making relative field offset work. also don't emit a field def for the resulting immediate
This is an imperfect revision of history.
2004-11-12 10:49:00 +00:00
Bill Currie
7dfd9ab502 Use the script api to parse progs.src instead of idparse. Now any additional tokens on the first line of progs.src are ignored and any additional tokens on subsequent lines get cumulatively added to the cpp command line. See progs.src[.in] in tools/qwaq for a simple example.
This is an imperfect revision of history.
2004-11-11 00:24:00 +00:00
Chris Ison
6ec1cfe389 win32 fix for over-compliant getopt 2004-02-05 03:27:35 +00:00
Bill Currie
3e5a103e55 proper error checking when openning progs.src 2004-01-22 04:16:19 +00:00
Bill Currie
7ef80d1da2 mske sure .self and .this are defined in progs.src mode (ie, @self and
@this)
2003-10-22 21:49:47 +00:00
Bill Currie
11c7c27f70 better relocations: pointers to structure members now work 2003-08-21 02:21:30 +00:00
Bill Currie
329c91fce4 expr.c:
qcc actually had the precedence of "!x && y" correct, so don't invert
	the logic for it in traditional code.
qfcc.c:
	allow the .debug_file def to be emitted in traditional mode.
2003-08-05 17:48:16 +00:00
Bill Currie
37f660801b QNX's printf doesn't like null pointers 2003-07-17 20:04:07 +00:00
Bill Currie
5fac3e6f3a fix a buffer underflow 2003-05-15 05:10:28 +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
8f4308c86a get .param_size and .debug_file linked in properly 2003-04-23 18:25:09 +00:00
Bill Currie
f7d806e8d5 can now handle > vector sized parameters 2003-04-22 20:11:16 +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
2ba8e871f3 convert \ to / in paths in windows 2003-02-24 21:51:08 +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
71196fedf6 make gcc more anal about prototypes, string constants and function
visibility (ie, global functions must have a prototype)
2003-01-06 18:28:13 +00:00
Bill Currie
7f69f593d3 configure.ac:
define default include and lib paths for qfcc
ruamoko:
	{cl_menu,game}/Makefile.am:
		conform to the new qfcc library linking rules
	lib/Makefile.am:
		install the libs to ${prefix}/lib/ruamoko
qfcc:
	linker.[ch]:
		support path searching for -llib and make linker_add_lib search for
		libfoo.a for -lfoo in the paths, or just a single dir search for the
		libname otherwise.
	options.c:
		support -L libpath and setup the default include and lib paths
		also change most strdup calls to save_string
	qfcc.c:
		check for foo.a as well as -lfoo when deciding whether the file is
		an object file or lib file.
2002-11-01 18:05:12 +00:00
Bill Currie
912db0336e clean out the cmdlib crap from quakefs.c and nuke qfcc's last dependency
on cmdlib.h (and nuke qfcc's cmdlib.h itself:)
2002-10-30 02:31:29 +00:00