Commit graph

175 commits

Author SHA1 Message Date
Wolfgang (Blub) Bumiller
6aefb22c74 ir_builder_delete now causes the ..._delete_quick functions to be used which will skip the removal of references: ir_value's won't have their read/write references removed by ir_instr_delete_quick 2012-08-24 20:39:47 +02:00
Wolfgang (Blub) Bumiller
b2315777d1 cache the IMMEDIATE string in the builder directly 2012-08-24 19:52:06 +02:00
Wolfgang (Blub) Bumiller
74cb075665 cache filenames as such instead of using code_cachedstring 2012-08-24 19:44:29 +02:00
Wolfgang (Blub) Bumiller
bdffa662b6 not using cachedstring on generated string values anymore, it's not the IR's job 2012-08-24 19:08:33 +02:00
Wolfgang (Blub) Bumiller
04dca17cff ir_value now checks if a name was specified 2012-08-24 18:14:39 +02:00
Wolfgang (Blub) Bumiller
2524d9c31b ir: don't require a label on a block 2012-08-24 18:03:57 +02:00
Wolfgang (Blub) Bumiller
f042068aab ir_value_life_merge_into: fix a possible underflow 2012-08-24 15:06:30 +02:00
Wolfgang (Blub) Bumiller
5e4b8846d1 slight change to ir_value_dump_life; fixing ir_value_life_merge_into: TODO test this seperately, all cases 2012-08-23 22:07:32 +02:00
Wolfgang (Blub) Bumiller
76b0eb0cb7 Don't add DEF_SAVEGLOBAL for locals actually... 2012-08-23 18:32:11 +02:00
Wolfgang (Blub) Bumiller
b2cb612c70 Adding DEF_SAVEGLOBAL, marking globals as to-be-saved now, for real support of quicksaving 2012-08-23 18:28:05 +02:00
Wolfgang (Blub) Bumiller
f9746a59ae it's not the IR's job to fail when a local of the same name is created twice... 2012-08-23 17:22:13 +02:00
Wolfgang (Blub) Bumiller
7e3ccf4626 MUL_VF and MUL_FV get their special life-range handling 2012-08-22 18:51:32 +02:00
Wolfgang (Blub) Bumiller
9296257c71 fix the functiondef's .locals... 2012-08-22 16:29:27 +02:00
Wolfgang (Blub) Bumiller
5d884bcb45 for liferange calc: the block we start from must tart with an empty set of living values 2012-08-22 16:20:26 +02:00
Wolfgang (Blub) Bumiller
eb86a3d7a3 fixing some debug output 2012-08-22 16:19:56 +02:00
Wolfgang (Blub) Bumiller
b2efef9be2 more info with -dump 2012-08-22 16:04:06 +02:00
Wolfgang (Blub) Bumiller
f6e5396f9f First generate the globals, then the fields, so the defs have the correct layout for quake 2012-08-22 14:15:49 +02:00
Wolfgang (Blub) Bumiller
5f2fc64498 -Wimplicit-function-pointer, functions without bodies still have a global function variable and thus are function pointers, though this shouldn't really be used, thus -Wimplicit-function-pointer is on by default 2012-08-22 12:37:06 +02:00
Wolfgang (Blub) Bumiller
5390782d9b Don't try to generate function code for functions without bodies 2012-08-22 12:33:24 +02:00
Wolfgang (Blub) Bumiller
1f32fe1d8a Since we currently append AINSTR_END to the end of all functions for debugging purposes, and darkplaces complains when the very last statement isn't INSTR_DONE or INSTR_RETURN, we append an INSTR_DONE at the very end 2012-08-21 18:12:01 +02:00
Wolfgang (Blub) Bumiller
9eb9c99e72 Do not generate an OFS_RETURN variable, the IR doesn't need to know it as such 2012-08-21 16:08:23 +02:00
Wolfgang (Blub) Bumiller
19b66800ae TYPE_FUNCTION values which are not constant are now allowed to be generated, they are function pointers. 2012-08-21 16:01:28 +02:00
Wolfgang (Blub) Bumiller
8f4333df30 right... instead of checking for end_sys_globals twice, maybe ACTUALLY check for end_sys_fields too... 2012-08-21 15:50:53 +02:00
Wolfgang (Blub) Bumiller
93856bf151 -Wvoid-variables, QC uses 2 special void-typed variables: end_sys_globals and .end_sys_fields. However if for some reason someone wants more, we still allow them to be code-generated, but by default warn about them by default 2012-08-21 15:49:53 +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
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
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
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
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
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
9eede6d303 fix a MEM_VECTOR_CLEAR to be done AFTER clearing the contents... 2012-08-18 15:53:35 +02:00
Wolfgang (Blub) Bumiller
39f37262db add LOAD for TYPE_FUNCTION as LOAD_FNC so we can actually access function fields 2012-08-18 12:44:17 +02:00
Wolfgang (Blub) Bumiller
32c095b622 Fix a possible endless loop in ir_values_overlap 2012-08-16 16:38:36 +02:00
Wolfgang (Blub) Bumiller
d9da4d11b1 Shutup visual studio... 2012-08-16 12:32:01 +02:00
Wolfgang (Blub) Bumiller
9430332ae5 ir.c: strcmp->memcpy 2012-08-15 17:02:48 +02:00
Wolfgang (Blub) Bumiller
abc574289f fix wrong count on IF/IFNOT jumps 2012-08-14 16:48:20 +02:00
Wolfgang (Blub) Bumiller
722be55fa9 removing all direct 'printfs' from ast and ir, replaced by the error interface 2012-08-14 13:14:32 +02:00
Wolfgang (Blub) Bumiller
e3b3c2efe3 Merge branch 'master' into blub/parser 2012-08-13 15:25:40 +02:00
Wolfgang (Blub) Bumiller
633561a730 type_eq_instr[], type_ne_instr[] 2012-08-13 15:25:14 +02:00
Wolfgang (Blub) Bumiller
5680c661a6 adding missing initializer for ir_value's member array 2012-08-12 21:56:53 +02:00