Commit graph

238 commits

Author SHA1 Message Date
Wolfgang Bumiller
eb8dc60981 Turn -fallow-unreachable-code into a -Wunreachable-code 2012-12-20 16:29:32 +01:00
Wolfgang Bumiller
4ef0e8c66e -g sets opts.g and -debug causes blocks to be labeled 2012-12-20 16:04:10 +01:00
Wolfgang Bumiller
bb356bffa5 that should have gone into the second to last commit 2012-12-20 15:27:15 +01:00
Wolfgang Bumiller
3119a95a89 -fallow-unreachable-code 2012-12-20 14:41:16 +01:00
Wolfgang (Blub) Bumiller
c8e163b0df ast_call now passes AST_FLAG_NORETURN on to the IR 2012-12-19 20:47:01 +01:00
Wolfgang (Blub) Bumiller
ba434c8e22 removing ast_expression_common.variadic, adding ast_expression_common.flags, added AST_FLAG_VARIADIC and AST_FLAG_NORETURN 2012-12-19 20:45:48 +01:00
Wolfgang (Blub) Bumiller
384446316a VINSTR_NRCALL, translated like any other call for now; to be used to mark a call which never returns, ie the error builtin 2012-12-19 20:38:32 +01:00
Rudolf Polzer
acf4da9385 Fixes for some minor bugs clang-analyzer and cppcheck found
Signed-off-by: Dale Weiler <killfieldengine@gmail.com>
2012-12-18 16:54:51 +00:00
Wolfgang (Blub) Bumiller
2a61a65ce0 -fperl-logic now doesn't allow logic ops with operands of different types, but therefore uses the correct output type 2012-12-18 16:56:22 +01:00
Dale Weiler
4b3e2571af Cleanups of compiler option configuration. Added ini/cfg parser system as well. 2012-12-18 04:57:17 +00:00
Wolfgang (Blub) Bumiller
68e4fb87d8 Fixed a bug in the generation of default switch cases: they can now fall through correctly 2012-12-17 17:01:07 +01:00
Wolfgang (Blub) Bumiller
ac18d58ffc Copy over the array-count in ast_type_adopt/ast_type_copy 2012-12-17 16:00:08 +01:00
Wolfgang (Blub) Bumiller
c2857a22e3 Let's still initialize the 'count' member... 2012-12-17 16:00:08 +01:00
Wolfgang (Blub) Bumiller
eab1050ba4 Fix: check error before calling codegen_output_type 2012-12-17 15:43:14 +01:00
Wolfgang (Blub) Bumiller
f9b1d057b5 Moving all the global opts_ variables into a struct, now there's one global 'opts' struct 2012-12-06 13:23:53 +01:00
Wolfgang (Blub) Bumiller
94560d1873 -Ominor -> -Opeephole; added -Olocaltemps flag; using a less space-wasting temp-allocation in general 2012-12-06 13:08:46 +01:00
Wolfgang (Blub) Bumiller
2eea7b03c0 get rid of some code duplication, and fix some wrong type adoptions in the ast 2012-12-05 16:22:32 +01:00
Wolfgang (Blub) Bumiller
8777624fe2 ast_block_add_expr now lets the block fully adopt the type of the added expression 2012-12-05 12:57:00 +01:00
Wolfgang (Blub) Bumiller
0c8bacd134 ast_ternary_codegen: use codegen_outpu_type 2012-12-04 14:11:49 +01:00
Wolfgang (Blub) Bumiller
6b575372cc Don't warn about uninitialized stuff in accessors - remove the liferanges calculated when finalizing accessors, this would add invalid liferanges to function-local arrays and thus suppress warnings randomly 2012-12-02 18:09:59 +01:00
Wolfgang (Blub) Bumiller
c926c4cb59 Sanity check in ast_generate_accessors 2012-12-02 18:02:44 +01:00
Wolfgang (Blub) Bumiller
02ec45363e Get rid of some code duplication 2012-12-02 17:57:08 +01:00
Wolfgang (Blub) Bumiller
07f4e6309d Some of the output types were superfluous; others are now put into a function to take care of it 2012-12-01 16:39:29 +01:00
Wolfgang (Blub) Bumiller
de837f2380 Add some more output and field types so you can now properly call 'get_a_function_which_gives_a_function()()()' without return values getting lost 2012-12-01 16:11:04 +01:00
Wolfgang (Blub) Bumiller
dfd8f14116 function pointer's output types need to be set for the IR to know 2012-12-01 15:23:40 +01:00
Wolfgang (Blub) Bumiller
d148cfdcd5 bodyless loops still have to loop 2012-11-30 21:34:49 +01:00
Wolfgang (Blub) Bumiller
2a3e7c1cff field constants - revert globals generated after fields 2012-11-30 21:11:25 +01:00
Wolfgang (Blub) Bumiller
316298650e remember if an ast_value is a field-declaration, build fields before globals 2012-11-30 21:03:57 +01:00
Wolfgang (Blub) Bumiller
1a264e5576 additional info in an internal error 2012-11-30 20:40:48 +01:00
Wolfgang (Blub) Bumiller
b3a9c4e8d9 Use the field parameter type on the raw paramter type list for their sizes. 2012-11-30 20:33:40 +01:00
Wolfgang (Blub) Bumiller
6fc00e523d All ir_instrs now get their lex-context, so that we can create an LNO file with -flno 2012-11-30 18:20:02 +01:00
Wolfgang (Blub) Bumiller
bda5ff4213 update other value/const check for array indexing 2012-11-30 16:28:09 +01:00
Wolfgang (Blub) Bumiller
696a8629b3 Don't treat initialized non-consts as static array indices 2012-11-30 16:25:18 +01:00
Wolfgang (Blub) Bumiller
9f1aa1490a out-of-bounds indexing check on static array indexing 2012-11-30 16:23:34 +01:00
Wolfgang (Blub) Bumiller
600ecda860 Set the full const/var qualifier; only generate warnings about unimplemented functions if they have no qualifier at all 2012-11-30 14:05:25 +01:00
Wolfgang (Blub) Bumiller
5e23e8296d don't just store a 'bool constant' in the ast/ir, store the complete qualifier: 'int cvq', moved CV_ defines into gmqcc.h 2012-11-30 13:47:28 +01:00
Wolfgang (Blub) Bumiller
39b8d8431c Actually generate the missing return instruction 2012-11-30 12:35:33 +01:00
Wolfgang (Blub) Bumiller
9841bc2f0d ast_loop with no condition and no incrementor are 'for(;;)' and need to loop endlessly instead of once... 2012-11-30 12:28:51 +01:00
Wolfgang (Blub) Bumiller
42376513e7 Still need to generate the jump... 2012-11-30 12:23:27 +01:00
Wolfgang (Blub) Bumiller
a19849099c ast_ifthen will not create dead blocks anymore 2012-11-30 12:21:10 +01:00
Wolfgang (Blub) Bumiller
a58061464e actually removing -Wmissing-return-values from parser.c and enabling the ast code for it 2012-11-30 12:11:36 +01:00
Wolfgang (Blub) Bumiller
8e1ce2ab5e generic compile_error/compile_warning functions in con.c, issuing end-of-non-void warning from within the ast now 2012-11-26 16:12:40 +01:00
Wolfgang (Blub) Bumiller
ec2ff09eff operator &~= must not cause the generated binstore to free the destination twice 2012-11-26 00:15:07 +01:00
Wolfgang (Blub) Bumiller
1c9de6763f Same as earlier: remember the outgoing block of a condition in a ternary since it could be different due to shortened logic 2012-11-25 23:54:15 +01:00
Wolfgang (Blub) Bumiller
bf244fc960 ast_breakcont_codegen: error when a target is missing instead of segfaulting trying to access it anyway 2012-11-25 23:51:39 +01:00
Wolfgang (Blub) Bumiller
0564e701c0 endlessloops don't have any other block which could be a continue-target-block, so use the body itself to not continue to NULL 2012-11-25 23:50:42 +01:00
Wolfgang (Blub) Bumiller
23e0637e85 ir_function_create_block now takes a lex_ctx instead of copying from the function; ast_ternary: need to remember the _end_ block of the 2 expressions because that's where the jump is actually supposed to be 2012-11-25 23:48:29 +01:00
Wolfgang (Blub) Bumiller
d70fcdec42 don't set the request-Lvalue flag for an array index 2012-11-25 23:35:49 +01:00
Wolfgang (Blub) Bumiller
7c241da548 more verbose errors in the ast when an ir-create fails 2012-11-25 23:32:10 +01:00
Wolfgang (Blub) Bumiller
0301ea7818 Don't error about creating an unreachable statement if the node we're about to generate is an ast_label 2012-11-25 21:59:57 +01:00