Commit graph

857 commits

Author SHA1 Message Date
Wolfgang (Blub) Bumiller
0d64e555e2 Better handling of EOF - encountering EOF in parser_next will not return false yet, this is a more elegant way... 2012-08-20 18:15:31 +02:00
Wolfgang (Blub) Bumiller
5a0995c767 better handlign of a too early error condition 2012-08-20 18:14:02 +02:00
Wolfgang (Blub) Bumiller
e0ffcfb74b Lexer now returns TOKEN_EOF only once and afterwards TOKEN_FATAL 2012-08-20 18:12:04 +02:00
Wolfgang (Blub) Bumiller
198e35a823 Fix correction of parsiong of multiple variables: parse past the comma 2012-08-20 18:10:06 +02:00
Wolfgang (Blub) Bumiller
99bab76006 Creating the ast_function for a function only when encountering its body, so if no body is specified it works like a function pointer - just like QC wants it 2012-08-20 18:09:41 +02:00
Wolfgang (Blub) Bumiller
20448b93dc Corrected parsing of declarations of multiple variables 2012-08-20 17:59:19 +02:00
Wolfgang (Blub) Bumiller
fe3b1b2e8d ir_values which are members of a vector should know that, so that liferange calc can use the vector rather than the member 2012-08-19 21:37:29 +02:00
Wolfgang (Blub) Bumiller
9420c01538 added -Wused-uninitialized and warning about variables which may be used without being initialized 2012-08-19 21:26:14 +02:00
Wolfgang (Blub) Bumiller
ede98f5521 Removing the old LIFE_RANGE_WITHOUT_LAST_READ support 2012-08-19 21:00:42 +02:00
Wolfgang (Blub) Bumiller
211b11f154 strip the newlines out of ir error messages, they're added by the msgprint routine 2012-08-19 20:45:26 +02:00
Wolfgang (Blub) Bumiller
a4c6382fa4 more context copies 2012-08-19 20:43:34 +02:00
Wolfgang (Blub) Bumiller
53b9906242 have the ir take over some more context data from the ast 2012-08-19 20:43:04 +02:00
Wolfgang (Blub) Bumiller
f0f9680774 add the backticks for a warning 2012-08-19 20:41:31 +02:00
Wolfgang (Blub) Bumiller
c2925b61f2 add the type for the invalid-type-for-global message 2012-08-19 20:37:10 +02:00
Wolfgang (Blub) Bumiller
af3d9e0bdf ir_value_set_string needs to use a strdup which doesn't return NULL for an emptystring 2012-08-19 20:35:51 +02:00
Wolfgang (Blub) Bumiller
c12e60a510 take 'warnreturn' into account, don't ignore the parsewarnin's Werror status 2012-08-19 20:32:07 +02:00
Wolfgang (Blub) Bumiller
1cc3705da4 Don't have the ast's codegen error on missing returns 2012-08-19 20:28:14 +02:00
Wolfgang (Blub) Bumiller
7ef248aadb set -Wmissing-return-values to on by default, new warning: control reaches end of non-void... 2012-08-19 20:26:54 +02:00
Wolfgang (Blub) Bumiller
66ec592f94 parse_block gets a warn-return bool flag 2012-08-19 20:20:39 +02:00
Wolfgang (Blub) Bumiller
14210a62ef functions which have no living values but store_return values may cause the allocator to be run with no allocations being made - in this case we shouldn't try accessing the empty array and simply exit the allocator 2012-08-19 19:54:15 +02:00
Wolfgang (Blub) Bumiller
4254845227 same as before for loops: don't try creating a jump if the body ends in a return 2012-08-19 19:45:53 +02:00
Wolfgang (Blub) Bumiller
49cd86e8ed don't try to create jumps in ifs if the block is already done 2012-08-19 19:43:41 +02:00
Wolfgang (Blub) Bumiller
adda894976 have function declarations of functions with prototypes take over the actual declaration's body's context data 2012-08-19 19:39:58 +02:00
Wolfgang (Blub) Bumiller
cadf877eb4 provide the context to ir_functions 2012-08-19 19:37:46 +02:00
Wolfgang (Blub) Bumiller
481baeeedc relax parse_close_paren to allow values in parenthesis with no operators... duh 2012-08-19 19:35:45 +02:00
Wolfgang (Blub) Bumiller
a93ed6ae80 fix: use thinkfunc not nextthink, nextthink is set later 2012-08-19 19:25:37 +02:00
Wolfgang (Blub) Bumiller
bd64d7d7b4 Automatic prototyping of frame-functions 2012-08-19 19:24:43 +02:00
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