Commit graph

830 commits

Author SHA1 Message Date
Wolfgang (Blub) Bumiller
9aa86bee16 Removing old commented-out code 2012-08-19 19:01:31 +02:00
Wolfgang (Blub) Bumiller
ece880d5e3 missing initializer 2012-08-19 18:03:56 +02:00
Wolfgang (Blub) Bumiller
e606913187 IR generation: for functions: first generate all defs, then the code, so access to prototyped functions doesn't result in NULL code 2012-08-19 18:00:53 +02:00
Wolfgang (Blub) Bumiller
655e882e63 setting data/frames.qc right again 2012-08-19 17:52:44 +02:00
Wolfgang (Blub) Bumiller
387335bb4d STOREP instructions' first operand has to be considered a read-operand, not a write operand, otherwise the life ranges will be wrong, and the value itself IS only read, not written to 2012-08-19 17:46:10 +02:00
Wolfgang (Blub) Bumiller
332d306723 for void returning functions we can use store_return to avoid a useless store after it 2012-08-19 17:42:22 +02:00
Wolfgang (Blub) Bumiller
e1ffa04bc2 calls for now use store_value since we don't properly deal with its liferange yet; fixing some local-alloation things; taking call parameters into account in ir_block_life_propagate 2012-08-19 17:29:36 +02:00
Wolfgang (Blub) Bumiller
611973bc59 Fixing a misleading error message in ir.c 2012-08-19 16:59:59 +02:00
Wolfgang (Blub) Bumiller
4d335c8704 ir: fix bug that functions without declared locals would put temps at position zero ... 2012-08-19 16:49:24 +02:00
Wolfgang (Blub) Bumiller
ae69812d92 Nicer prints in exec's prog_print_statement 2012-08-19 16:42:12 +02:00
Wolfgang (Blub) Bumiller
49ad9ef006 fix a wrong print in parsing.qc test 2012-08-19 16:41:45 +02:00
Wolfgang (Blub) Bumiller
bc36414434 Oops setting wrong members 2012-08-19 16:18:39 +02:00
Wolfgang (Blub) Bumiller
464317dc4b data/frames.qc to test [frame,think] 2012-08-19 16:14:19 +02:00
Wolfgang (Blub) Bumiller
dae13e87de First draft of handling the [frame,think] notation 2012-08-19 16:13:29 +02:00
Wolfgang (Blub) Bumiller
dc5555e084 qcvm: -trace flag 2012-08-19 15:19:43 +02:00
Wolfgang (Blub) Bumiller
92d40e0925 Factoring out duplicate code into a function: create_vector_members; creating vector members for vector function parameters 2012-08-19 14:34:23 +02:00
Wolfgang (Blub) Bumiller
78d04a8352 implement correct behaviour for shadows locals 2012-08-18 21:56:42 +02:00
Wolfgang (Blub) Bumiller
ee3aaa58b3 -Wlocal-shadows - note that -std=gmqcc is very different from the rest 2012-08-18 21:54:19 +02:00
Wolfgang (Blub) Bumiller
deccf4e708 splitting parser_find_local up into find_local and find_param - find_local also takes a bool-ptr to tell the caller if it was a local or a global 2012-08-18 21:42:52 +02:00
Wolfgang (Blub) Bumiller
28891c5a37 quotes around the variable name in some messages 2012-08-18 21:35:47 +02:00
Wolfgang (Blub) Bumiller
cd820c831f remove trailing \n from 2 error messages 2012-08-18 21:32:29 +02:00
Wolfgang (Blub) Bumiller
83a758e446 set olddecl so we don't access a NULL value when a variable already exists 2012-08-18 21:31:53 +02:00
Wolfgang (Blub) Bumiller
fc1622140b oops - parsewarning returns true on -Werror, so we gotta invert here 2012-08-18 21:07:23 +02:00
Wolfgang (Blub) Bumiller
4d0be789ac -Wtoo-few-parameters on by deafult - for -std=gmqcc it's always an error 2012-08-18 21:04:16 +02:00
Wolfgang (Blub) Bumiller
20635c5ae4 ast_type_adopt - ast_entfield now adopts the full type of the field 2012-08-18 20:30:24 +02:00
Wolfgang (Blub) Bumiller
6223d78ee3 -Wmissing-return-values, off by default, ignored with -std=gmqcc because in that standard it'll error 2012-08-18 20:19:43 +02:00
Wolfgang (Blub) Bumiller
588cd5018f data/vars.qc - when declaring a function, and it had a prototype - use the new parameter names instead of the ones from the prototype, otherwise things get messy 2012-08-18 20:16:51 +02:00
Wolfgang (Blub) Bumiller
99fe673f0a ast_unary needs to set its type 2012-08-18 20:02:18 +02:00
Wolfgang (Blub) Bumiller
7cc1609117 Disable the member-of namespace check when -std != gmqcc 2012-08-18 19:43:34 +02:00
Wolfgang (Blub) Bumiller
d88e3e8f24 move the member-of check for '.' to after applying the previous dot operators so we don't need parens around 'a.b' of 'a.b.c = x' 2012-08-18 19:42:38 +02:00
Wolfgang (Blub) Bumiller
0d4e6a2ee8 data/functions.qc for some more tests 2012-08-18 19:39:48 +02:00
Wolfgang (Blub) Bumiller
40fe52e665 ast_call: adopt the funciton's return type 2012-08-18 19:37:51 +02:00
Wolfgang (Blub) Bumiller
b7b0fcdc94 ast_return_delete: check if self->operand is actually set before ast_unref-ing it 2012-08-18 18:01:52 +02:00
Wolfgang (Blub) Bumiller
586bb07c4d Use the current context, not the one from a NULL value... for ast_return 2012-08-18 18:00:20 +02:00
Wolfgang (Blub) Bumiller
701c387dbf parse 'return' without values better 2012-08-18 17:58:51 +02:00
Wolfgang (Blub) Bumiller
6d84010dc4 ast_return should accept NULL as value to create a simple 'return' without a value 2012-08-18 17:58:38 +02:00
Wolfgang (Blub) Bumiller
2cf4895cc7 Fixup some possibly uninitialized value when parsing 'return' 2012-08-18 17:48:29 +02:00
Wolfgang (Blub) Bumiller
e239d2a33b set expression.next to NULL in ast_block_set_type if it won't be set to a new value 2012-08-18 17:46:02 +02:00
Wolfgang (Blub) Bumiller
0e3bc87c75 Don't re-add defs which had a prototype 2012-08-18 17:42:38 +02:00
Wolfgang (Blub) Bumiller
79d8275eee adding data/proto.qc 2012-08-18 17:32:32 +02:00
Wolfgang (Blub) Bumiller
24a21d0816 ast_value_copy should copy the expression substructure as well - exposing ast_value_copy to the outside since the parser needs to copy complete types when multiple variables are declared with commas 2012-08-18 17:16:20 +02:00
Wolfgang (Blub) Bumiller
3effcd2342 initialize the ast_expression node in ast_shallow_type properly as well 2012-08-18 16:58:17 +02:00
Wolfgang (Blub) Bumiller
9ffb79111f initialize the ast_expression node in ast_type_copy properly 2012-08-18 16:57:22 +02:00
Wolfgang (Blub) Bumiller
4cf017bb6b keep the filenames of all lexed files in a global lex_filenames vector because we don't strdup the filenames into lex_ctx, but copy the pointer 2012-08-18 16:47:33 +02:00
Wolfgang (Blub) Bumiller
6daf47fc5b set parser->lex to NULL after closing 2012-08-18 16:42:17 +02:00
Wolfgang (Blub) Bumiller
16b5f28b40 don't deallocate the parser on a compile error -_- 2012-08-18 16:40:20 +02:00
Wolfgang (Blub) Bumiller
304cf173cd ast_member's are now kept, since they are used like variables: multiple times 2012-08-18 16:38:50 +02:00
Wolfgang (Blub) Bumiller
ff1506983b Add a comment about why we don't delete the owner 2012-08-18 16:32:07 +02:00
Wolfgang (Blub) Bumiller
6acf131369 Doh... wrong comment type 2012-08-18 16:30:28 +02:00
Wolfgang (Blub) Bumiller
ffd41cb1c7 ast_member will not unref/delete the owner: first of all the owner is always an ast_value, which won't get deleted anyway, secondly: the ast_members are collected and deleted after the owners, so ast_unref(owner) will cause invalid memory access 2012-08-18 16:30:09 +02:00