Commit Graph

61 Commits

Author SHA1 Message Date
Bill Currie e1158a83f0 Begin work on rewriting obj_file.c for the new format. 2011-02-22 15:42:49 +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 b5424bca7d Start work on getting expressions converted to internal statements. 2011-01-19 15:47:45 +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 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 c8b7622e0e reduce the amount of memory wasted when generating the output file 2009-12-20 12:19:16 +00:00
Bill Currie c542138300 more not-really initialized data 2009-12-20 11:54:19 +00:00
Bill Currie 9ac15436d9 More docs.
Enhance qfprogs qfo debugging.

Make sure functions marked as extern don't emit anything. Fixes the segfault
when building klik.
2008-08-01 13:54:24 +00:00
Bill Currie 3e50aae01f "print" command for dumping values in the progs and add return type info to the debugging information 2007-09-15 07:47:31 +00:00
Bill Currie 845b5ab2e2 don't write alias defs to the qfo 2007-04-09 14:25:44 +00:00
Bill Currie 9509d0fd5e make qfo files typesize safe 2007-04-07 12:35:03 +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 f1c9a8d24b remove a mostly unused field 2004-02-21 05:58:01 +00:00
Bill Currie b38486d405 make rel_def_op work properly 2003-08-22 19:48:14 +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 44285ba5de speed up qfo writing by about 12.5:1 (for large object files, anyway) by
making compression optional (compressed qfo files will still be handled
transparently)
2003-02-23 23:43:43 +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 ca4b3acd6c big protototype cleanup. Now, except for a few cases, all non-static
prototypes are in headers files.
2002-11-05 19:12:51 +00:00
Bill Currie 5a182b7cd4 turns out that flags == 0 is quite valid (d'oh) 2002-10-16 06:33:14 +00:00
Bill Currie 6af57049d5 make pointers work a bit better 2002-10-16 02:04:06 +00:00
Bill Currie 412db7e27d "for example" is more appropriate than "that is" 2002-09-16 15:42:11 +00:00
Bill Currie e5227076e0 put in some error checking on the Qopen calls 2002-09-10 15:46:50 +00:00
Bill Currie ec47e08e1c go back to using QFile, quakeio.h and quakefs.h 2002-08-27 07:16:28 +00:00
Bill Currie aaab480676 fix a bunch of potential malloc (0) calls 2002-08-25 23:16:07 +00:00
Bill Currie 36ca7b55bd fix several problems caused by insufficient error checking and some double
Qclose calls
2002-08-15 18:53:03 +00:00
Bill Currie a431a2783c byteswap the reloc def field too (fixes the qfcc seg on big-endian systems) 2002-08-09 04:06:50 +00:00
Bill Currie 1e49f0d0c3 fix a segfault (what was I thinking when I wrote that line?) 2002-07-23 05:44:45 +00:00
Bill Currie c2a7564d55 implement -l, but -L isn't supported yet and the full lib name must be given 2002-07-21 07:12:17 +00:00
Bill Currie b0d568d85f local defs for debug info now work 2002-07-17 15:40:08 +00:00
Bill Currie 980be66c0e bah, missed this file 2002-07-17 14:21:52 +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 17c2def821 def merging seems to mostly work (have some problems with method lists) 2002-07-16 06:40:34 +00:00
Bill Currie b9a237b13d rename qfo_function_t to qfo_func_t and similar for other qfo *function* in
obj_file.[ch]
2002-07-15 21:37:52 +00:00
Bill Currie e550ad670a more linking fixes, including seting up relocations. not quite working yet 2002-07-13 06:09:03 +00:00
Bill Currie b48d71fdcc make qfo functions 0 based. now having weird def problems :/ 2002-07-12 22:27:40 +00:00
Bill Currie 2a121d000f fix a couple of dumb bugs and update the function number calculation 2002-07-12 20:43:11 +00:00
Bill Currie 06c03dd074 make local defs always come after global defs in linked qfo files and make
function relocations work better
2002-07-12 20:26:51 +00:00
Bill Currie 24d473c386 more linking fixes 2002-07-12 06:17:24 +00:00
Bill Currie 0f5f68623f it's as broken as all-get-out, but object files can now be linked 2002-07-11 22:38:23 +00:00
Bill Currie a9899087d3 fix a bunch of silly bugs and get the linked output written (hangs, though) 2002-07-11 21:04:09 +00:00
Bill Currie 4d1dbc8cc1 re-write qfo writing from progs, make qfo creation easier, (mostly) finish
the linker. now for testing :)
2002-07-11 20:17:26 +00:00
Bill Currie bc5beea311 getting closer to being able to link 2002-07-11 17:06:15 +00:00
Bill Currie 2cb6138f2b fix a silly segfault and make statement allocation saner 2002-07-08 20:31:59 +00:00
Bill Currie e815669b7a finish (for now:/) qfo_to_progs 2002-07-08 16:13:06 +00:00
Bill Currie 24e242ed35 move the type strings into their own string pool so the progs strings don't
get cluttered
2002-07-08 05:26:50 +00:00
Bill Currie 598edb26fd parse a type back from its encoding (some info will be lost) 2002-07-08 05:10:05 +00:00
Bill Currie 8a402381e6 redo how progs strings are stored so multiple pools can exist 2002-07-05 20:02:10 +00:00