a lot simpler VLA code

Author: Philip <pipcet@gmail.com>
    Our VLA code can be made a lot simpler (simple enough for
    even me to understand it) by giving up on the optimization idea, which
    is very tempting. There's a patch to do that attached, feel free to
    test and commit it if you like. (It passes all the tests, at least
This commit is contained in:
seyko
2015-05-04 04:09:05 +03:00
parent fca58734fb
commit 999274ca90
4 changed files with 33 additions and 94 deletions

6
tcc.h
View File

@ -464,12 +464,6 @@ typedef struct DLLReference {
#define SYM_FIELD 0x20000000 /* struct/union field symbol space */
#define SYM_FIRST_ANOM 0x10000000 /* first anonymous sym */
#define VLA_SP_LOC_SET 0x01 /* Location of SP on stack has been allocated */
#define VLA_SP_SAVED 0x02 /* SP has been saved to slot already */
#define VLA_NEED_NEW_FRAME 0x04 /* Needs new frame for next VLA */
#define VLA_IN_SCOPE 0x08 /* One or more VLAs are in scope */
#define VLA_SCOPE_FLAGS (VLA_SP_SAVED|VLA_NEED_NEW_FRAME|VLA_IN_SCOPE) /* Flags which are saved and restored upon entering and exiting a block */
/* stored in 'Sym.c' field */
#define FUNC_NEW 1 /* ansi function prototype */
#define FUNC_OLD 2 /* old function prototype */