re-apply VLA by Thomas Preud'homme

This commit is contained in:
Joe Soroka
2011-04-06 09:17:03 -07:00
parent 17571298f3
commit ace0f7f259
7 changed files with 173 additions and 35 deletions

4
tcc.h
View File

@ -224,6 +224,7 @@ typedef struct Sym {
union {
long c; /* associated number */
int *d; /* define token stream */
SValue *s; /* associated stack value */
};
CType type; /* associated type */
union {
@ -617,6 +618,7 @@ struct TCCState {
#define VT_BTYPE 0x000f /* mask for basic type */
#define VT_UNSIGNED 0x0010 /* unsigned type */
#define VT_ARRAY 0x0020 /* array type (also has VT_PTR) */
#define VT_VLA 0x20000 /* VLA type (also has VT_PTR and VT_ARRAY) */
#define VT_BITFIELD 0x0040 /* bitfield modifier */
#define VT_CONSTANT 0x0800 /* const modifier */
#define VT_VOLATILE 0x1000 /* volatile modifier */
@ -631,7 +633,7 @@ struct TCCState {
#define VT_EXPORT 0x00008000 /* win32: data exported from dll */
#define VT_WEAK 0x00010000 /* win32: data exported from dll */
#define VT_STRUCT_SHIFT 17 /* shift for bitfield shift values */
#define VT_STRUCT_SHIFT 18 /* shift for bitfield shift values */
/* type mask (except storage) */
#define VT_STORAGE (VT_EXTERN | VT_STATIC | VT_TYPEDEF | VT_INLINE | VT_IMPORT | VT_EXPORT | VT_WEAK)