From 2a2d3273eae791c5c21eb77374f4818c2a76ae1b Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 12 Mar 2020 14:40:13 +0000 Subject: Add `@require` for global variables --- src/check_decl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/check_decl.cpp') diff --git a/src/check_decl.cpp b/src/check_decl.cpp index ece38e84f..0e12a2822 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -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) { -- cgit v1.2.3