Commit graph

7607 commits

Author SHA1 Message Date
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
b812c0e235 Disable -Wlogical-op for gcc 4.4 or lower.
It seems to be broken before 4.5.
2011-03-21 21:54:00 +09:00
Bill Currie
1219df0872 Fix field immediates.
Field immediates need to be treated the same way as pointer immediates when
merging values.
2011-03-21 18:11:46 +09:00
Bill Currie
46093c0937 Use the correct meta type for spacial types.
Although vector and quaternion types have symbol tables, they are not
really structs, so set the meta type to "none", allowing the types to be
encoded correctly.
2011-03-21 17:26:49 +09:00
Bill Currie
cefe7e2e94 Use the correct source of defs for field defs. 2011-03-21 17:07:40 +09:00
Bill Currie
0c0f4360da Make field defs "nosave".
The engine treats fielddefs with DEF_SAVEGLOBAL set as bogus.
2011-03-21 17:06:45 +09:00
Bill Currie
bc0cffc9c6 Fix handling of autorelease pools in the menu code.
Create a "menu_pre" function that creates the autorelease pool, change
menu_post() to release the pool correctly, and make the menu internal code
require and call menu_pre.
2011-03-21 13:14:14 +09:00
Bill Currie
a9e139e14c Correct a minor logic error.
We don't want to always add a new autorelease pool, and we certainly want
one if there are none.
2011-03-21 13:12:30 +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
7c113a12db Make zone errors a little more useful. 2011-03-20 15:50:09 +09:00
Bill Currie
025c39cc02 Ensure stdout is flushed in the progs signal_hook() 2011-03-20 13:35:59 +09:00
Bill Currie
a919e5f619 Make class_check_ivars() use class_add_ivars() to add the ivars.
This avoids implementation ivar blocks trashing the ivar offsets in
derived classes.
2011-03-20 13:35:59 +09:00
Bill Currie
104c29e4da Avoid a segfault when the called function is invalid.
This is most likely to occur when dumping code from qfo files with external
functions.
2011-03-20 13:35:12 +09:00
Bill Currie
f20424afe5 Make "bad type" output more useful.
Print the four (assumes non-v6) values in hex rather than "bad type".
2011-03-17 20:35:14 +09:00
Bill Currie
ebfbd7c358 Disable the unsigned comparison instructions.
They need unsigned support, or special treatment, so they have to wait.
2011-03-17 20:33:38 +09:00
Bill Currie
8c8a6a4d63 The function return type is the address of the type descriptor... 2011-03-17 20:31:20 +09:00
Bill Currie
01144d23cf Add a new gcc warning option and fix the two bugs it found. 2011-03-17 19:58:56 +09:00
Bill Currie
7b9d70167f Fix some missed language changes. 2011-03-10 20:51:04 +09:00
Bill Currie
5aa0b34570 Add the cast statement to the statement block.
*sob*
2011-03-10 20:43:53 +09:00
Bill Currie
f663f587fe Fix the missing local defs for builtin functions. 2011-03-10 20:16:35 +09:00
Bill Currie
899af3119b Use the correct type when generating a move expression. 2011-03-10 19:30:21 +09:00
Bill Currie
2129eaaf20 Dereference moves need movepi rather than movei. 2011-03-10 19:29:23 +09:00
Bill Currie
bce3935ea6 Add a void address instruction. 2011-03-10 19:28:03 +09:00
Bill Currie
8d69c5c898 More tests 2011-03-09 20:34:23 +09:00
Bill Currie
cbbbf87e20 Resurrect the stats output. 2011-03-09 15:51:17 +09:00
Bill Currie
8368f57fbf Close a potential buffer overflow. 2011-03-09 11:09:46 +09:00
Bill Currie
4d90eba2ad Remove some unused globals. 2011-03-09 11:08:30 +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
39278ba8cc Explicitly select between direct and indirect moves. 2011-03-09 10:30:57 +09:00
Bill Currie
90de6b0499 Add a movepi instruction to support indirect moves of fixed size. 2011-03-09 10:29:24 +09:00
Bill Currie
18005cc80d Rename move to movei. 2011-03-09 10:28:40 +09:00
Bill Currie
6c4563b21d Change movep's name from <MOVE> to <MOVEP>. 2011-03-09 10:25:20 +09:00
Bill Currie
b95cdc33d9 Set instace_size to the correct size. 2011-03-08 22:45:34 +09:00
Bill Currie
4432bc0bef Make the offset in zone dumps more useful. 2011-03-08 22:44:56 +09:00
Bill Currie
55eed1ae07 Make module dumping a little more informative. 2011-03-08 22:43:53 +09:00
Bill Currie
7c770b75c5 Do not creat field defs for local storage.
This prevents field params and local vars from messing up the real field
defs.
2011-03-08 19:56:02 +09:00
Bill Currie
f66e20db17 Set the dereferenced type in the field value. 2011-03-08 19:29:36 +09:00
Bill Currie
7198be5726 Treat entities a bit like structures in field_expr ().
Look in the entity field symbol table for the field before looking in the
normal symbol table. This allows entity fields to be accessed even when
the current scope has symbol of the same name. However, checking the
normal symbol table where there is no such field allows for field
variables when I get around to implementing them.
2011-03-08 19:28:11 +09:00
Bill Currie
505bde308e Fix the handling of @system defs.
When treating a def as external, actually say it is external.
2011-03-07 20:53:27 +09:00
Bill Currie
8dbf8a97ea Be more informative with ext/def internal errors. 2011-03-07 20:52:31 +09:00
Bill Currie
6312ccba81 Fix storage class blocks.
@extern { defs }; etc
2011-03-07 20:51:51 +09:00
Bill Currie
4db8ebb6af Support qcc style local function variables. 2011-03-07 20:04:05 +09:00
Bill Currie
853cc53d0f FIx the handling of storage class. 2011-03-07 17:49:01 +09:00
Bill Currie
7649549de6 Handle external field declarations. 2011-03-07 17:23:52 +09:00
Bill Currie
49e446b637 Make field defs global.
It turns out that field defs need to be global after all, so use separate
field def tables in the linker.
2011-03-07 14:45:50 +09:00
Bill Currie
041c5d53b8 Check for the vector being a constant before trying to get its value. 2011-03-07 14:04:36 +09:00
Bill Currie
c069bafad8 Support casting from enum to float. 2011-03-07 14:04:05 +09:00
Bill Currie
5a78758781 Support return in void functions in v6 code. 2011-03-07 13:52:28 +09:00
Bill Currie
1246fd9e30 Use the correct size when growing a data space. 2011-03-07 13:36:00 +09:00