Add @require for global variables

This commit is contained in:
gingerBill
2020-03-12 14:40:13 +00:00
parent e0a370f8f1
commit 2a2d3273ea
4 changed files with 27 additions and 5 deletions

View File

@@ -843,6 +843,11 @@ void check_global_variable_decl(CheckerContext *ctx, Entity *e, Ast *type_expr,
check_decl_attributes(ctx, decl->attributes, var_decl_attribute, &ac);
}
if (ac.require_declaration) {
array_add(&ctx->info->required_global_variables, e);
}
e->Variable.thread_local_model = ac.thread_local_model;
e->Variable.is_export = ac.is_export;
if (ac.is_static) {