Commit graph

  • 13082112b0 create the ir_function in ast_function_codegen, keep the current ir_block stored in ast_function so inner codegens can use it Wolfgang (Blub) Bumiller 2012-05-02 19:25:25 +0200
  • 1e9d02da14 going through function blocks in ast_function_codegen Wolfgang (Blub) Bumiller 2012-05-02 19:21:25 +0200
  • 314d45ff82 ast_local/global_codegen exposed through the header for now Wolfgang (Blub) Bumiller 2012-05-02 18:36:11 +0200
  • 92a4431c86 ast_local_codegen - similar structure to global_codegen obviously... Wolfgang (Blub) Bumiller 2012-05-02 18:34:24 +0200
  • 7a48377442 for ast_value_codegen this should be enough, since the actual generation happens in other functions Wolfgang (Blub) Bumiller 2012-05-02 18:25:59 +0200
  • bc318bb68e More function parsing for assembler Dale Weiler 2012-05-02 11:48:46 -0400
  • ca7ab3fd5f assembly statement operand parsing. Now all we need is tables and state to generate some valid code. Dale Weiler 2012-05-01 20:36:37 -0400
  • eaaa1d15d8 test.qs update Dale Weiler 2012-05-01 18:05:41 -0400
  • 629f6f1e63 Assembly statement parsing Dale Weiler 2012-05-01 18:05:11 -0400
  • d51718118a Function parsing for the assembler now works, and adds the function to the function table for the code writer, quake and darkplaces can see it as well (since a def is also created) Dale Weiler 2012-05-01 16:42:11 -0400
  • 1e0a688bc5 ast_ternary - contrary to ast_ifthen neither ontrue nor onfalse can be NULL, and it does output a value Wolfgang Bumiller 2012-05-01 17:02:45 +0200
  • 5fe87e6a20 if-then-else AST node - this one is not for ternary expressions Wolfgang Bumiller 2012-05-01 16:55:02 +0200
  • bb7c59c648 Remove 2 unused variables in create_binop - unused since create_general_instruction Wolfgang Bumiller 2012-05-01 16:45:15 +0200
  • 22cf7e0a4d Fix missing 'int op;' in load_from_end, accidently removed it together with the other vars whil making it use general_instruction Wolfgang Bumiller 2012-05-01 16:44:36 +0200
  • 8ab51544be Comment about the form of instruction general_instr is used for Wolfgang Bumiller 2012-05-01 16:29:29 +0200
  • cde5444f24 create_phi -> store_value, not store_local... phi output cannot be overwritten Wolfgang Bumiller 2012-05-01 16:27:36 +0200
  • 0337320054 Reuse general_instr to shorten create_binop Wolfgang Bumiller 2012-05-01 16:26:25 +0200
  • 3c07ed15c0 expose create_general_instr in ir.h for now... Wolfgang Bumiller 2012-05-01 16:24:16 +0200
  • 282edea8de Get rid of duplicate code by adding an ir_block_create_general_instr Wolfgang Bumiller 2012-05-01 16:23:45 +0200
  • 6ae8a69ab0 ir_block_create_fieldaddress - and fixing operand-numbering in load_from_ent Wolfgang Bumiller 2012-05-01 16:20:44 +0200
  • 4fbcc57d49 Commenting on future lvalue use in ast_store Wolfgang Bumiller 2012-05-01 15:15:19 +0200
  • 3a94e962ae codegen gets an lvalue flag now Wolfgang Bumiller 2012-05-01 15:14:44 +0200
  • 4c165cbd07 ast_instantiate should check return value of mem_a and return NULL on error Wolfgang Bumiller 2012-05-01 15:09:17 +0200
  • 281bd8657a ast_entfield node Wolfgang Bumiller 2012-05-01 15:08:54 +0200
  • eb21f1e733 alignment fix Wolfgang Bumiller 2012-05-01 12:43:10 +0200
  • 45651cea8d Implementation of liferange overlap test Wolfgang Bumiller 2012-05-01 12:40:37 +0200
  • ddbd460331 Check for TYPE_FIELD in load_from_ent Wolfgang Bumiller 2012-05-01 12:14:07 +0200
  • 18969b1713 style fix Wolfgang Bumiller 2012-05-01 12:13:04 +0200
  • 4c38566877 ir_block_create_load_from_ent - long name, I know, but we need to be able to load from pointers too at some point... Wolfgang Bumiller 2012-05-01 12:12:53 +0200
  • 5f0800bef6 support TYPE_FIELD in stores; storeP to do a different kind of type checking Wolfgang Bumiller 2012-05-01 12:05:47 +0200
  • 340daeabc4 ir_block_create_storep for storing through pointers, the IR does not implicitly create conversions for now when using pointers, but it could Wolfgang Bumiller 2012-05-01 11:58:52 +0200
  • 95152c1f5c VECTOR_PROT Dale Weiler 2012-04-29 19:08:20 -0400
  • f19cbe1400 Parse vector constants and add them to the constants table now for the assembler. Dale Weiler 2012-04-29 19:03:06 -0400
  • 8156374a71 Invoke tests Dale Weiler 2012-04-29 17:28:01 -0400
  • 453ca45176 added test_ast, test_ir, and test, as well as default, and all to the Makefile target list. Also made all tests C90 conformant code. Dale Weiler 2012-04-29 16:54:05 -0400
  • 8c91adeb9f Merge branch 'master' into ast-and-ir Dale Weiler 2012-04-29 16:39:43 -0400
  • 1db21393cf Remove Makefile_win (useless) Dale Weiler 2012-04-29 16:38:38 -0400
  • 69d93409e5 params should be deleted, not unref()d Wolfgang Bumiller 2012-04-29 19:45:14 +0200
  • 5d64001c36 64bit signed/unsigned integer support from the compiler if LONG_MAX != 0x7FFFFFFF Dale Weiler 2012-04-29 12:09:30 -0400
  • c3df4edebd Remove trailing whitespace Dale Weiler 2012-04-28 19:03:16 -0400
  • 5751e41993 After moving ast_instantiate up, the checks which return NULL now must mem_d(self) Wolfgang Bumiller 2012-04-29 00:41:35 +0200
  • 674ae4b7da Fix macro spacing Dale Weiler 2012-04-28 18:56:44 -0400
  • 3e7a8c0e78 All code is now C89/C90 compat Dale Weiler 2012-04-28 18:56:09 -0400
  • 206952b920 Merge branch 'master' into ast-and-ir Dale Weiler 2012-04-28 16:45:02 -0400
  • 05966ee009 Remove trailing whitespace from everything Dale Weiler 2012-04-28 16:43:39 -0400
  • a5e1f40b85 gitattributes for whitespace Dale Weiler 2012-04-28 16:40:03 -0400
  • f697a5f999 lex.c -> lex_init s/lex->line = 0/lex->line = 1/ Dale Weiler 2012-04-28 16:31:30 -0400
  • 37ff28a3b5 This should fix line counting issues with the lexer Dale Weiler 2012-04-28 16:30:44 -0400
  • 7a81848d88 Lexer fixes Dale Weiler 2012-04-28 16:25:43 -0400
  • 6dff77aa95 ast and ir testers - to use: compile into gmqcc and execut the functions in main() Wolfgang Bumiller 2012-04-28 21:42:12 +0200
  • bdb238b705 param_argument cleanup Dale Weiler 2012-04-28 15:36:39 -0400
  • 1b13c86cc9 param_argument cleanup Dale Weiler 2012-04-28 15:20:13 -0400
  • 488859a218 Do not force -[aci] parameters' arguments to be in the same argv; (Allow 'gmqcc -c foo' to act like 'gmqcc -cfoo' Wolfgang Bumiller 2012-04-28 14:32:52 +0200
  • 2a9b3c7877 ast_function gets a handle to its ir_function, ast_global_codegen to generate an ir global, or an ir_function Wolfgang Bumiller 2012-04-28 18:54:27 +0200
  • eef92df092 First delete the blocks, THEN the locals, since blocks USE locals, darn Wolfgang Bumiller 2012-04-28 17:29:43 +0200
  • 6145ecf7e0 ast_binary takes 2 expressions, not 2 values, ast_store takes a value and and expression for now until we support pointers, also: dropped the 'keep' param from ast_value_new, values are always to be stored somewhere to be deleted independently from their uses Wolfgang Bumiller 2012-04-28 17:27:06 +0200
  • 0f38a560b6 ast_value and ast_function are linked together when using ast_function_new, note however, that neither will delete the other in their _delete functions. Wolfgang Bumiller 2012-04-28 15:57:19 +0200
  • df9a685f61 surpress empty bodies Dale Weiler 2012-04-28 15:13:41 -0400
  • 7d66144c1b vector parsing for assembly Dale Weiler 2012-04-28 07:27:03 -0400
  • e4a839df95 Get rid of ast_setfunc Wolfgang Bumiller 2012-04-28 12:51:44 +0200
  • b4caecf088 Cut at comma Dale Weiler 2012-04-28 06:35:42 -0400
  • 261e47d9b4 Merge remote-tracking branch 'origin/ast-and-ir' into ast-and-ir Dale Weiler 2012-04-28 06:32:32 -0400
  • 1d6594a491 Fixed all invalid mmeory accesses Dale Weiler 2012-04-28 06:31:16 -0400
  • 50f00fb0a7 Adding debug dump functions Wolfgang Bumiller 2012-04-28 11:50:01 +0200
  • 8035563a45 Fixed: block-labels were NULLed after being set -_- Wolfgang Bumiller 2012-04-28 11:49:52 +0200
  • f3a9c8c362 2 missind free->mem_d in MEM_VECTOR macros Wolfgang Bumiller 2012-04-28 11:30:52 +0200
  • b09d75518c almost ISO C now, fixed all the MEM_VECTOR trailing semicolon issues. Dale Weiler 2012-04-28 05:54:24 -0400
  • 75b78720fd lex_ctx_t -> lex_ctx, vector_t -> vector Wolfgang Bumiller 2012-04-28 11:13:16 +0200
  • 72053e16d2 Interface change Dale Weiler 2012-04-28 05:35:32 -0400
  • 33b1995fa5 struct lex_file -> lex_file Dale Weiler 2012-04-28 05:25:19 -0400
  • 89ed723efa astir.h -> gmqcc.h Dale Weiler 2012-04-28 05:08:03 -0400
  • 434bf4b5b2 Merge branch 'blub/ast-and-ir-merging' of github.com:graphitemaster/gmqcc into ast-and-ir Dale Weiler 2012-04-28 05:03:31 -0400
  • 857ca631a4 windows makefile update Dale Weiler 2012-04-28 05:01:19 -0400
  • da827e6098 Removed the qc_type enum and replaced all qc_* by TYPE_* Wolfgang Bumiller 2012-04-28 10:42:03 +0200
  • e74ecabedd Add shouldn't clear on failure either, it would be rather ugly to handle Wolfgang Bumiller 2012-04-28 10:32:10 +0200
  • 1bf4aa379a Header guards and macros get {} in oneline ifs and loops Wolfgang Bumiller 2012-04-28 10:17:32 +0200
  • 858d9734a2 Merge branch 'assembler' into ast-and-ir Dale Weiler 2012-04-28 04:12:24 -0400
  • de01d34925 type parsing for constants, globals and locals. Sanatize constants to select internal functions to prevent possible runtime issues that could be a result of atoi working for what we consider invalid strings containing constants. Dale Weiler 2012-04-28 03:53:23 -0400
  • fd31c203dc Better codegen Dale Weiler 2012-04-28 03:37:14 -0400
  • 07c6aea7dc assembler can parse internal functions. Wrote all internal functions (that are not extensions) to test.qs Dale Weiler 2012-04-28 03:26:40 -0400
  • 403901d6ee More assembly work Dale Weiler 2012-04-28 02:34:39 -0400
  • 20f203495d More assembler code Dale Weiler 2012-04-27 16:45:34 -0400
  • 7aee8ac2ef Working on the assembler Dale Weiler 2012-04-27 16:31:38 -0400
  • 8d87767afa 2 missing return values Wolfgang Bumiller 2012-04-27 18:00:57 +0200
  • 9867ce26b3 a vector_remove shouldn't clear the vector when failing to reallocate as a smaller chunk, just return false. The value is still removed from the vector, so no unstable state is generated by this, which makes a _remove safe to ignore where it makes sense. Wolfgang (Blub) Bumiller 2012-04-27 13:53:49 +0200
  • ce43a35307 ast_value_set_name to return bool Wolfgang (Blub) Bumiller 2012-04-27 13:32:52 +0200
  • e4d92130da Using GMQCC_WARN some more where it makes sense Wolfgang (Blub) Bumiller 2012-04-27 13:31:40 +0200
  • 86564686f3 Turned nearly every void-returning function into a bool-returning function, and checking return values wherever necessary to be able to properly exit on failures Wolfgang (Blub) Bumiller 2012-04-27 13:28:39 +0200
  • 8f290e7989 Use GMQCC_WARN on generated vector functions Wolfgang (Blub) Bumiller 2012-04-27 12:38:53 +0200
  • 348243ddf6 GMQCC_WARN macro Wolfgang (Blub) Bumiller 2012-04-27 12:35:59 +0200
  • 4b6659bfe1 Get rid of realloc Wolfgang (Blub) Bumiller 2012-04-27 11:41:12 +0200
  • 8e13e8ab11 whitespace Dale Weiler 2012-04-27 05:33:22 -0400
  • 422c085fba Sanity check Dale Weiler 2012-04-27 05:33:02 -0400
  • 69173876f1 Merge branch 'master' into blub/ast-and-ir-merging Wolfgang (Blub) Bumiller 2012-04-27 11:05:57 +0200
  • db879bd626 Now compiles with mingw; added makefile for windows. Dale Weiler 2012-04-26 23:23:31 -0400
  • dd66080aaf removed clutter Dale Weiler 2012-04-26 23:20:35 -0400
  • 63b6abb463 GMQCC_VERSION Dale Weiler 2012-04-26 11:37:47 -0400
  • fdc98383d1 Adding a 'keep' bool to nodes: Generally, destroying an AST node should destroy all its child-nodes, global variables get 'keep' to be true to avoid them being deleted together with expressions they're used in. Wolfgang (Blub) Bumiller 2012-04-26 11:45:22 +0200
  • 1a917a2659 Introduce an ast_store rather than splitting ast_binary Wolfgang (Blub) Bumiller 2012-04-26 11:36:46 +0200
  • 06bdc46864 Use .o rather than .c in the Makefile... sorry for that mistake Wolfgang (Blub) Bumiller 2012-04-26 11:36:28 +0200