aboutsummaryrefslogtreecommitdiff
path: root/tccasm.c
diff options
context:
space:
mode:
authorgrischka <grischka>2017-07-09 12:34:11 +0200
committergrischka <grischka>2017-07-09 12:34:11 +0200
commit9ba76ac834608f76b734674048a7cc4334051e32 (patch)
tree8d71dd52664d0399fb010fd502283993b0d67285 /tccasm.c
parent9f79b62ec4d84d07cf4a2fba969cb67c8f6ed8e5 (diff)
downloadtinycc-9ba76ac834608f76b734674048a7cc4334051e32.tar.gz
tinycc-9ba76ac834608f76b734674048a7cc4334051e32.tar.bz2
refactor sym & attributes
tcc.h: * cleanup struct 'Sym' * include some 'Attributes' into 'Sym' * in turn get rid of VT_IM/EXPORT, VT_WEAK * re-number VT_XXX flags * replace some 'long' function args by 'int' tccgen.c: * refactor parse_btype()
Diffstat (limited to 'tccasm.c')
-rw-r--r--tccasm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tccasm.c b/tccasm.c
index f22ed9f..59264ce 100644
--- a/tccasm.c
+++ b/tccasm.c
@@ -58,7 +58,7 @@ ST_FUNC Sym* get_asm_sym(int name, Sym *csym)
/* We might be called for an asm block from inside a C routine
and so might have local decls on the identifier stack. Search
for the first global one. */
- while (csym && csym->scope)
+ while (csym && csym->sym_scope)
csym = csym->prev_tok;
}
/* Now, if we have a defined global symbol copy over
@@ -74,7 +74,7 @@ ST_FUNC Sym* get_asm_sym(int name, Sym *csym)
/* XXX can't yet store st_size anywhere. */
sym->type.t &= ~VT_EXTERN;
/* Mark that this asm symbol doesn't need to be fed back. */
- sym->type.t |= VT_IMPORT;
+ sym->a.dllimport = 1;
}
}
return sym;
@@ -418,7 +418,7 @@ static void asm_free_labels(TCCState *st)
s1 = s->prev;
/* define symbol value in object file */
s->type.t &= ~VT_EXTERN;
- if (s->r && !(s->type.t & VT_IMPORT)) {
+ if (s->r && !s->a.dllimport) {
if (s->r == SHN_ABS)
sec = SECTION_ABS;
else
@@ -693,9 +693,9 @@ static void asm_parse_directive(TCCState *s1, int global)
if (tok1 != TOK_ASMDIR_hidden)
sym->type.t &= ~VT_STATIC;
if (tok1 == TOK_ASMDIR_weak)
- sym->type.t |= VT_WEAK;
+ sym->a.weak = 1;
else if (tok1 == TOK_ASMDIR_hidden)
- sym->type.t |= STV_HIDDEN << VT_VIS_SHIFT;
+ sym->a.visibility = STV_HIDDEN;
next();
} while (tok == ',');
break;