commit 0563d5ea64239a5434a4592763642158432ffcaf
parent e662eea3f936ac70c6dc835ba29a4d7322621dab
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 23 Nov 2021 09:41:39 +0100
all: remove @hidden
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
6 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/include/ast.h b/include/ast.h
@@ -363,7 +363,6 @@ struct ast_expression {
struct ast_global_decl {
char *symbol;
- bool hidden;
struct identifier ident;
struct ast_type *type;
struct ast_expression *init;
@@ -378,7 +377,6 @@ struct ast_type_decl {
struct ast_function_decl {
char *symbol;
- bool hidden;
struct identifier ident;
struct ast_function_type prototype;
struct ast_expression *body;
diff --git a/include/lex.h b/include/lex.h
@@ -7,7 +7,6 @@
// Keep sorted
enum lexical_token {
T_ATTR_FINI,
- T_ATTR_HIDDEN,
T_ATTR_INIT,
T_ATTR_NORETURN,
T_ATTR_OFFSET,
diff --git a/src/check.c b/src/check.c
@@ -2904,7 +2904,6 @@ check_function(struct context *ctx,
decl->func.type = fntype;
decl->func.flags = afndecl->flags;
- decl->hidden = afndecl->hidden;
if (afndecl->symbol) {
decl->symbol = strdup(afndecl->symbol);
}
@@ -2996,7 +2995,6 @@ check_global(struct context *ctx,
decl->global.type = type;
decl->global.value = value;
- decl->hidden = adecl->hidden;
if (adecl->symbol) {
decl->ident.name = strdup(adecl->symbol);
decl->symbol = strdup(adecl->symbol);
diff --git a/src/lex.c b/src/lex.c
@@ -15,7 +15,6 @@
static const char *tokens[] = {
// Must be alpha sorted and match lex.h
[T_ATTR_FINI] = "@fini",
- [T_ATTR_HIDDEN] = "@hidden",
[T_ATTR_INIT] = "@init",
[T_ATTR_NORETURN] = "@noreturn",
[T_ATTR_OFFSET] = "@offset",
diff --git a/src/parse.c b/src/parse.c
@@ -2301,9 +2301,6 @@ parse_global_decl(struct lexer *lexer, enum lexical_token mode,
case T_ATTR_SYMBOL:
i->symbol = parse_attr_symbol(lexer);
break;
- case T_ATTR_HIDDEN:
- i->hidden = true;
- break;
default:
unlex(lexer, &tok);
break;
@@ -2326,8 +2323,7 @@ parse_global_decl(struct lexer *lexer, enum lexical_token mode,
case T_COMMA:
lex(lexer, &tok);
if (tok.token == T_NAME
- || tok.token == T_ATTR_SYMBOL
- || tok.token == T_ATTR_HIDDEN) {
+ || tok.token == T_ATTR_SYMBOL) {
i->next = xcalloc(1, sizeof(struct ast_global_decl));
i = i->next;
unlex(lexer, &tok);
@@ -2380,9 +2376,6 @@ parse_fn_decl(struct lexer *lexer, struct ast_function_decl *decl)
case T_ATTR_FINI:
decl->flags |= FN_FINI;
break;
- case T_ATTR_HIDDEN:
- decl->hidden = true;
- break;
case T_ATTR_INIT:
decl->flags |= FN_INIT;
break;
diff --git a/src/typedef.c b/src/typedef.c
@@ -423,7 +423,7 @@ emit_typedefs(struct unit *unit, FILE *out)
for (struct declarations *decls = unit->declarations;
decls; decls = decls->next) {
struct declaration *decl = decls->decl;
- if (!decl->exported || decl->hidden) {
+ if (!decl->exported) {
continue;
}