Commit fd4d2e0b authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Provide a function to get a symbols full name

parent a29d1e8c
......@@ -322,6 +322,7 @@ void vcc_Eval_Func(struct vcc *, const struct vjsn_val *,
const char *, const struct symbol *);
void VCC_GlobalSymbol(struct symbol *, vcc_type_t fmt, const char *pfx);
struct symbol *VCC_HandleSymbol(struct vcc *, vcc_type_t , const char *);
void VCC_SymName(struct vsb *, const struct symbol *);
/* vcc_obj.c */
void vcc_Var_Init(struct vcc *);
......
......@@ -72,6 +72,16 @@ VCC_PrintCName(struct vsb *vsb, const char *b, const char *e)
VSB_printf(vsb, "_%02x_", *b);
}
void
VCC_SymName(struct vsb *vsb, const struct symbol *sym)
{
if (sym->parent != NULL && sym->parent->parent != NULL) {
VCC_SymName(vsb, sym->parent);
VSB_putc(vsb, '.');
}
VSB_cat(vsb, sym->name);
}
static struct symbol *
vcc_new_symbol(struct vcc *tl, const char *b, const char *e)
{
......
......@@ -326,17 +326,6 @@ vcc_CheckUses(struct vcc *tl)
/*---------------------------------------------------------------------*/
static void
vcc_pnam(struct vcc *tl, const struct symbol *sym)
{
if (sym->parent != tl->symbols) {
vcc_pnam(tl, sym->parent);
Fc(tl, 0, ".");
}
Fc(tl, 0, "%s", sym->name);
}
static void v_matchproto_(symwalk_f)
vcc_xreftable(struct vcc *tl, const struct symbol *sym)
{
......@@ -347,7 +336,7 @@ vcc_xreftable(struct vcc *tl, const struct symbol *sym)
Fc(tl, 0, " * %-8s ", sym->kind->name);
Fc(tl, 0, " %-9s ", sym->type->name);
Fc(tl, 0, " %2u %2u ", sym->lorev, sym->hirev);
vcc_pnam(tl, sym);
VCC_SymName(tl->fc, sym);
if (sym->wildcard != NULL)
Fc(tl, 0, "*");
Fc(tl, 0, "\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment