From e7c71e24730ae07241980812c8b747963f216260 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Wed, 22 Nov 2017 17:57:43 +0100 Subject: tccasm: synch C and asm symtab tighter See testcase. The C and asm symtab are still separate, but integrated tighter: the asm labels are only synched at file end, not after each asm snippet (this fixes references from one to another asm block), the C and asm syms are synched both ways, so defining things in asm and refering from C, or the other way around works. In effect this model reflects what happens with GCC better. For this the asm labels aren't using the C label namespace anymore, but their own, which increases the size of each TokenSym by a pointer. --- tcc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index da26298..1efd046 100644 --- a/tcc.h +++ b/tcc.h @@ -383,6 +383,7 @@ typedef struct TokenSym { struct Sym *sym_label; /* direct pointer to label */ struct Sym *sym_struct; /* direct pointer to structure */ struct Sym *sym_identifier; /* direct pointer to identifier */ + struct Sym *sym_asm_label; /* direct pointer to asm label */ int tok; /* token number */ int len; char str[1]; @@ -1584,6 +1585,7 @@ ST_FUNC Sym* get_asm_sym(int name, Sym *csym); ST_FUNC void asm_expr(TCCState *s1, ExprValue *pe); ST_FUNC int asm_int_expr(TCCState *s1); ST_FUNC int tcc_assemble(TCCState *s1, int do_preprocess); +ST_FUNC void asm_free_labels(TCCState *st); /* ------------ i386-asm.c ------------ */ ST_FUNC void gen_expr32(ExprValue *pe); #ifdef TCC_TARGET_X86_64 -- cgit v1.3.1