Commit graph

273 commits

Author SHA1 Message Date
Wolfgang Bumiller
1fd7e30de6 code_cachedstring 2012-05-09 15:03:19 +02:00
Wolfgang Bumiller
edcb976053 Convenience function to store a predefined string in the qc string area 2012-05-09 15:03:19 +02:00
Wolfgang Bumiller
8bfbe4d619 Preparing to generate code from the IR - code_write should return a bool, and take a filename rather than use program.dat hardcoded 2012-05-09 15:03:19 +02:00
Dale Weiler
ac890513e4 readme s/\t/ /g 2012-05-06 17:00:16 -04:00
Dale Weiler
4a1f67bb97 Updated readme 2012-05-06 16:58:30 -04:00
Dale Weiler
fc1844e2a2 Merge branch 'master' of github.com:graphitemaster/gmqcc 2012-05-04 22:01:26 -04:00
Dale Weiler
99971b7806 util_strncmpexact 2012-05-04 22:01:02 -04:00
Wolfgang (Blub) Bumiller
704394c0a2 removing ast-test macro concept 2012-05-04 13:04:06 +02:00
Wolfgang (Blub) Bumiller
87b08247a1 A new ast-test, now using some macros to make them easier to write... 2012-05-04 12:28:35 +02:00
Wolfgang (Blub) Bumiller
200b425db0 Fixed some dangling '}', it compiles again now 2012-05-04 12:26:24 +02:00
Wolfgang (Blub) Bumiller
73749db6b4 What was I thinking... fixing loop's jump creation so it doesn't try creating multiple jumps... this code is also much more readable 2012-05-04 12:24:44 +02:00
Wolfgang (Blub) Bumiller
c670a8d278 ast_loop must end by entering the outgoing block 2012-05-04 12:01:53 +02:00
Wolfgang (Blub) Bumiller
e0331ef15f Changing life-range calculation to include the last read because then it doesn't need another vector to keep elements in. In order for this to make sense, the life-range overlap test now returns false if the end of one range _equals_ the beginning of the other, since that's not truly overlapping anymore 2012-05-04 10:20:04 +02:00
Wolfgang (Blub) Bumiller
2f92dedb4c Move the output block of a loop to after the loop, otherwise IR dumps looks just messy... note that this is merely a cosmetic change 2012-05-04 10:01:38 +02:00
Dale Weiler
6b52c66d11 More assembly parsing (function call stuff) 2012-05-03 19:45:59 -04:00
Wolfgang (Blub) Bumiller
c3460c1654 ast_function gets 'breakblock' and 'continueblock' for break and continue support; fixed some typos; added huge ast_loop_codegen implementation... need to go through it and check 2012-05-04 00:16:51 +02:00
Dale Weiler
510d795c06 More assembler code (less allocations too) 2012-05-03 16:54:34 -04:00
Wolfgang (Blub) Bumiller
a1a9fc797d Same for ternary: reordered a bit, and fixing ontrue->onfalse at the jump back to the merge block 2012-05-03 22:07:58 +02:00
Wolfgang (Blub) Bumiller
8a543bfae1 reorder ifthen codegen and fix a jump generation where I used ontrue instead of onfalse 2012-05-03 22:05:20 +02:00
Wolfgang (Blub) Bumiller
375cfd24b3 ast_loop - codegen dummied 2012-05-03 21:57:13 +02:00
Wolfgang (Blub) Bumiller
3e974a1a24 If-protect on_true and on_false in ast_ifthen since they can be NULL (contrary to ast_ternary where they can't) 2012-05-03 21:56:05 +02:00
Wolfgang (Blub) Bumiller
bbcd3f12de Removing TODO-comment since it's done 2012-05-03 18:38:29 +02:00
Wolfgang (Blub) Bumiller
b5aed08c93 Dump should print a warning if lifepasses don't match... 2012-05-03 14:17:00 +02:00
Wolfgang (Blub) Bumiller
46122235e6 ast_function_codegen: Add a return instruction if it is missing, or error if we're not in a void-function 2012-05-03 14:15:02 +02:00
Wolfgang (Blub) Bumiller
bd84ebcf74 ast-test should also finalize functions directly 2012-05-03 14:04:35 +02:00
Wolfgang (Blub) Bumiller
5c385a3c78 naive_phi now recognizes both store_local and store_value as non-global, create_store prints the operand names on an invalid store to a value of store-type store_value 2012-05-03 14:01:56 +02:00
Wolfgang (Blub) Bumiller
4acea855c5 ir-test.c to use assertions, abort alone creates an ugly output 2012-05-03 14:00:38 +02:00
Wolfgang (Blub) Bumiller
0f023bc219 sprintf with length modifiers is annoying... 2012-05-03 13:45:24 +02:00
Wolfgang (Blub) Bumiller
627ef279fd ast_test to build an IR 2012-05-03 13:26:49 +02:00
Wolfgang (Blub) Bumiller
4c9c6ee5bd ast_ternary_codegen - beware, it's almost a spaghetti... almost... 2012-05-03 13:02:29 +02:00
Wolfgang (Blub) Bumiller
91bf040f0a ast_function_label now takes a labelname to prefix the id with 2012-05-03 12:40:49 +02:00
Wolfgang (Blub) Bumiller
54c92d5ae1 ast_ifthen_codegen 2012-05-03 12:38:43 +02:00
Wolfgang (Blub) Bumiller
2c329db9b9 ast_entfield_codegen 2012-05-03 12:19:33 +02:00
Wolfgang (Blub) Bumiller
da9a4fef29 Type information moved to ast_expression from ast_value, every ast node should in theory know its type - it is important for dereferencing pointers or entity fields, to figure out the output type. Eg. so that ast_entfield knows what kind of OP_LOAD it needs to use 2012-05-03 12:12:22 +02:00
Dale Weiler
c1a85378d5 Trailing whitespace was imminent, pending editor configuration change to accomodate insanity. 2012-05-02 18:03:17 -04:00
Dale Weiler
21e992aa3a supress attribute warnings 2012-05-02 17:57:45 -04:00
Dale Weiler
1ae035c714 Merge remote-tracking branch 'origin/ast-and-ir' 2012-05-02 17:46:21 -04:00
Wolfgang (Blub) Bumiller
4317f40fa5 ast_binary_codegen, ast_function_label (no I don't like sprintf...) 2012-05-02 23:11:39 +02:00
Dale Weiler
5a1cc405af Merge branch 'master' into ast-and-ir 2012-05-02 15:50:50 -04:00
Dale Weiler
fbe86450dc argsize parsing for assembler 2012-05-02 15:48:00 -04:00
Wolfgang (Blub) Bumiller
75c60657ac ast_store_codegen and its l/rvalue handling 2012-05-02 20:36:11 +02:00
Wolfgang (Blub) Bumiller
4fe806edc2 A note to clarify the ast_block/ir_block difference 2012-05-02 19:46:27 +02:00
Wolfgang (Blub) Bumiller
307eb2d9a2 ast_block_codegen - as you can see, an ast_block doesn't actually care about ir_blocks 2012-05-02 19:45:16 +02:00
Wolfgang (Blub) Bumiller
13082112b0 create the ir_function in ast_function_codegen, keep the current ir_block stored in ast_function so inner codegens can use it 2012-05-02 19:25:25 +02:00
Wolfgang (Blub) Bumiller
1e9d02da14 going through function blocks in ast_function_codegen 2012-05-02 19:21:25 +02:00
Wolfgang (Blub) Bumiller
314d45ff82 ast_local/global_codegen exposed through the header for now 2012-05-02 18:36:11 +02:00
Wolfgang (Blub) Bumiller
92a4431c86 ast_local_codegen - similar structure to global_codegen obviously... 2012-05-02 18:34:24 +02:00
Wolfgang (Blub) Bumiller
7a48377442 for ast_value_codegen this should be enough, since the actual generation happens in other functions 2012-05-02 18:25:59 +02:00
Dale Weiler
bc318bb68e More function parsing for assembler 2012-05-02 11:48:46 -04:00
Dale Weiler
ca7ab3fd5f assembly statement operand parsing. Now all we need is tables and state to generate some valid code. 2012-05-01 20:36:37 -04:00