Bill Currie
739ebc522c
Begin working on flow analysis.
...
For now, variable and flow graph node maps are built.
2012-11-15 13:44:06 +09:00
Bill Currie
93b007b1f8
Take care of relocs when defining external defs.
...
For most of the cases, some relocs may have been lost, but they were
certainly lost for type encodings. Now that all seems to be fixed.
2012-11-12 16:14:09 +09:00
Bill Currie
61ef901254
Tweak some FIXMEs.
2012-11-08 17:03:02 +09:00
Bill Currie
ed4018fd8d
Clear out the function overloading tables between compiles.
...
Fixes some issues with multiple compiles (especially mixed languages!).
2012-11-01 20:53:33 +09:00
Bill Currie
ec42bde527
Make hash tables more const correct.
...
And clean up the resulting mess :/
2012-10-27 11:44:31 +09:00
Bill Currie
3f351a5c88
Fix a printf format goof.
...
Forgot to compile test :/
2012-10-26 19:38:59 +09:00
Bill Currie
27b83a8d65
Clean up all extra aborts, using internal_error instead.
...
Some internal_error calls have no message, but at least things will be more
consistent.
2012-10-26 19:02:02 +09:00
Bill Currie
23a38738fc
Massive whitespace cleanup.
...
Lots of trailing whitespace and otherwise blank lines.
2012-05-22 08:23:22 +09:00
Bill Currie
bc1b483525
Nuke the rcsid stuff.
...
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Bill Currie
6a49861b49
Fix the bogus source file for "redefined" functions.
2011-03-22 13:45:44 +09:00
Bill Currie
f1d9570dc8
Fix constant value type handling.
...
Rename immediate.[ch] to value.[ch] and clean up the mess.
Add convert_value() to convert the type of a value (only scalar types).
2011-03-22 12:24:39 +09:00
Bill Currie
f5ce9e2004
Fix a merge induced error in overloaded functions.
2011-03-20 19:04:18 +09:00
Bill Currie
1ada2a96cf
Merge branch 'master' into qfcc-codegen
...
Conflicts:
tools/qfcc/source/expr.c
tools/qfcc/source/function.c
tools/qwaq/test.r
2011-03-20 15:58:31 +09:00
Bill Currie
f663f587fe
Fix the missing local defs for builtin functions.
2011-03-10 20:16:35 +09:00
Bill Currie
2464a89d37
Preserve relocs across def churning.
...
Freeing then re-allocating a def to change its storage from external is
really not the right way to do it, but for now this fixes the loss of the
relocs. With this, the menus seem to work :)
2011-03-09 10:52:29 +09:00
Bill Currie
02a70ebe1c
Remove the auxfunction manipulation from the compiler proper.
...
It was broken code in the first place (realloc and pointers), and is
redundant with the new linking process.
2011-03-07 13:33:02 +09:00
Bill Currie
bad5fddec4
Fix overloaded function resolution.
...
Update the expression symbol pointer, not just the symbol name.
2011-03-03 14:44:48 +09:00
Bill Currie
c10a551c84
Rename new_defspace() and defspace_new_loc().
2011-02-24 13:07:36 +09:00
Bill Currie
4336fc2c73
Move method function defs into the far data space.
...
As they are never referenced directly by instructions, there's no need for
them to be in the near data space, taking precious def locations.
2011-02-15 15:33:18 +09:00
Bill Currie
5707888fcf
Fix some error-recovery segfaults.
2011-02-14 23:10:46 +09:00
Bill Currie
181596f5bf
Make relocation records store the space of the relocation.
...
The space is meaningless for op_* relocations as they are always in the
code space, but def_* relocations need to know which space holds the
location to be adjusted.
2011-02-12 22:34:38 +09:00
Bill Currie
681ded9375
Fix debug line number information.
2011-02-09 09:59:43 +09:00
Bill Currie
5eff00fdeb
Fix debug information.
2011-02-09 08:47:01 +09:00
Bill Currie
8c6fc6fb03
Fix a double insertion of a symbol.
2011-02-08 08:44:08 +09:00
Bill Currie
d564e6f017
Clean out the old debug prints from emit_function()
2011-02-07 08:46:12 +09:00
Bill Currie
f2c272f0b8
Make adding a symbol to multiple tables an internal error.
2011-02-06 20:00:14 +09:00
Bill Currie
f44a26e268
Fix type chaining when dealing with decls.
2011-02-03 21:32:58 +09:00
Bill Currie
7fb8c8247e
Don't do a find_type on the parsed function.
...
This is needed for C style declarations, but breaks QuakeC style. The fix
is to do the find_type once the return type has been filled in.
2011-02-02 15:08:59 +09:00
Bill Currie
d11d128c96
Avoid segfaulting on errors.
2011-02-01 21:18:39 +09:00
Bill Currie
80ce179bc2
Scan the param list for problems with void.
2011-02-01 21:18:08 +09:00
Bill Currie
80424f6ad5
Ensure functions are always properly terminated.
...
Control that reaches the end of a function must see a return statement.
2011-01-28 13:14:30 +09:00
Bill Currie
36c99a8da1
Get function def creation working again.
2011-01-26 14:48:22 +09:00
Bill Currie
6ce3c5a59a
Get statments being emitted to the code segment.
...
The first function seems to work fine, but there's a problems with the
scope of params causing params to get their knickers in a twist (tangled
linked list).
2011-01-25 15:46:48 +09:00
Bill Currie
849d013f5e
Allocate space for function parameters.
2011-01-25 15:43:57 +09:00
Bill Currie
a648f043de
Give functions their own defspace.
...
The defspace is propogated through the function's sub-scopes.
2011-01-25 12:34:45 +09:00
Bill Currie
0624408317
Move the diagnostic functions into their own file.
2011-01-24 21:54:57 +09:00
Bill Currie
d618e51dc8
Move save_string and make_string into strpool
...
Might not be the perfect place, but at least they're strongly related.
2011-01-24 21:32:48 +09:00
Bill Currie
483cbeba03
Fix a few FIXMEs.
2011-01-24 21:13:37 +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
e08efe036b
Move the constant expression values into their own struct.
2011-01-19 08:43:24 +09:00
Bill Currie
ff6e1b4d6c
Get functions attempting to generate code.
...
However, the statements are only printed as expressions.
2011-01-19 08:38:09 +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
c4d19e6ebc
Get __PRETTY_FUNCTION__ working for overloaded functions.
2011-01-13 16:22:27 +09:00
Bill Currie
0c9522b1ca
Fix overloaded functions.
2011-01-13 16:21:31 +09:00
Bill Currie
ac14db7b1b
Create a function to ease param list building.
...
This is especially useful for QuakePascal, but it will mean I'll be able to
get rid of the parameter reversals in Ruamoko later on.
2011-01-13 14:45:53 +09:00
Bill Currie
638f4445cc
More return code cleanup.
...
Don't use the true void return in traditional mode.
Prefer the true void return over "done" at the end of functions.
Don't emit the above if the last emitted statement is a return and there is
no label at the end of the function.
2011-01-13 00:46:46 +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
7971b0868e
Break out the begin_function code into its own function.
2011-01-10 12:25:31 +09:00