Bill Currie
b5424bca7d
Start work on getting expressions converted to internal statements.
2011-01-19 15:47:45 +09:00
Bill Currie
f2ef24d0cc
Make symbols use the new value struct for constants.
2011-01-19 11:09:54 +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
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
d3a98af783
Make internal_error globally available.
2011-01-17 22:34:41 +09:00
Bill Currie
8f71986306
Add symbol expressions (like def expressions).
...
They will eventually replace def expressions. Currently quite broken.
2011-01-13 14:54:24 +09:00
Bill Currie
258c896e4d
Create a function to build if/else blocks.
2011-01-13 14:33:16 +09:00
Bill Currie
c787923c99
Forgot to remove that print_expr.
2011-01-11 12:11:54 +09:00
Bill Currie
08bf7e24de
Produce nicer code for post-op.
...
The temp notice is still there for arrays (that's caused by issues in
constfold.c, not easily fixilbe), but it's harmless and correct (and nice)
code is much more important.
2011-01-11 12:07:48 +09:00
Bill Currie
ad787ae98a
Set the expression type to the correct value for addresses.
2011-01-11 12:06:40 +09:00
Bill Currie
21d7c78eb7
Allow deep copying of expression trees.
...
Certain expression types (eg labels) are created fresh.
2011-01-11 12:05:29 +09:00
Bill Currie
abe471110c
Make inc/dec_users return the the expression.
...
Just for convenience.
2011-01-11 08:44:43 +09:00
Bill Currie
18ae178eaf
Make new_vector_expr and new_quaternion_expr const-correct.
2011-01-11 08:43:34 +09:00
Bill Currie
cd38bd71fa
Swap the order of scale and base for calculating the array index.
...
fold_constants doesn't like dags very much, but it can do the right thing
if the expressions are in the right order. This is merely a workaround
until I get to work on the code generator itself.
2011-01-10 12:26:11 +09:00
Bill Currie
d327c860cb
Get messages working again.
2011-01-10 12:26:11 +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
02f78e46f8
More expression docs.
2011-01-03 16:25:59 +09:00
Bill Currie
5627e43465
Use the method's selector rather than its def name in error messages.
2011-01-03 16:25:29 +09:00
Bill Currie
a4635d79e8
Slightly more informative error locations.
...
Inside a class or protocol definition is not "at top level" ;)
2011-01-03 16:25:29 +09:00
Bill Currie
530e8fae34
Rework class_type_t to be more useful.
...
This allows current_class to refer to procols as well (for error
reporting).
2011-01-03 16:25:29 +09:00
Bill Currie
52e844ee48
Produce slightly better v6 modulo code for complex inputs.
...
I'm having problems with temp defs, but I imagine this code is rarely used
so I won't worry about it for now. It will, however, make a good test case
for when I rework emit.c after I do some reading.
2010-12-19 11:23:33 +09:00
Bill Currie
d981968208
v6 modulo implementation now produces good code.
...
At least for simple inputs, anyway. That needs to be tested next.
2010-12-18 22:21:55 +09:00
Bill Currie
00e50c0ad3
Rewrite the v6 modulo implementation.
...
While trying to understand bind expressions, I discovered that the v6
modulo code was incorrect. This version is correct but uses one too many
temps. That's next.
2010-12-18 22:21:55 +09:00
Bill Currie
eace5b3c81
Get message checking working properly.
2010-12-16 16:41:16 +09:00
Bill Currie
e28ee0378f
Gracefully handle returning NIL though a bad type.
2010-11-24 17:01:18 +09:00
Bill Currie
67beaf4487
Nil is a constant, so allow it in global initializers.
2010-11-24 17:01:18 +09:00
Bill Currie
799d46f83d
Check for incomplete types and better param/return size checking.
2010-11-24 17:01:17 +09:00
Bill Currie
997102fea8
audit the usage of "only"
...
There are still a few iffy places (notably around certain prepositions), but
the relevant sentences are now much easier to read.
2010-01-13 06:42:26 +00:00
Bill Currie
0d4a2938a2
forgot to check for errors
2010-01-13 06:32:10 +00:00
Bill Currie
ae4fc3147d
allow '*pointer' expressions
2010-01-13 06:31:41 +00:00
Bill Currie
ccb8faf6ef
produce a warning for the likes of "x - x & y"
2010-01-13 06:26:18 +00:00
Bill Currie
40fefff847
fix incorrect users for temps resulting from casting the result of ?:
...
There are probably other situations, but I'll fix them as they show up.
2010-01-13 06:25:06 +00:00
Bill Currie
090527eaec
silence some debug output
2010-01-13 06:20:22 +00:00
Bill Currie
fe95805d86
various gcc 4.3 fixes
2008-07-19 05:40:57 +00:00
Bill Currie
a521a78adb
catch more uninitialized variables
2007-05-13 08:39:07 +00:00
Bill Currie
c81c074660
mark used constants as used
2007-05-13 08:20:19 +00:00
Bill Currie
2149aefe67
not so sure that one's needed
2007-05-08 03:24:49 +00:00
Bill Currie
5798c9d67a
wasn't catching the precedence inversion in (x - x & y) even though it was caught for (x & y - x).
2007-05-08 02:54:50 +00:00
Bill Currie
3deee307a8
check for uninitialized variables in return statements
2007-04-28 08:48:01 +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
966c337bf5
use the def's declaration line rather than the function's when reporting auto-initialization
2007-04-06 11:05:52 +00:00
Bill Currie
04765083aa
really warn only once for each uninitialized variable
2007-04-06 08:56:37 +00:00
Bill Currie
5a8143a9c7
support float = vector and vector = float for traditional
2007-04-06 08:23:07 +00:00
Bill Currie
72af804b31
nested include reporting
2007-03-31 15:27:36 +00:00
Bill Currie
904197c70e
allow assignment of arrays to poitners
2006-12-11 09:26:45 +00:00
Bill Currie
728dde167d
explicity state errors are errors rather than leaving it implicit (tracking
...
gcc's messages again;)
2005-08-17 23:05:10 +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
66cabb587f
add the vector-calls "optimisation" from fteqcc. makes it possible to
...
compile the version of frogbot with waypoints for almost 300 maps.
2005-06-10 07:31:25 +00:00
Bill Currie
554f4d071a
get the type right when accessing arrays in a struct (in a pointer?)
...
This is an imperfect revision of history.
2004-11-13 13:22:30 +00:00