diff options
| author | gingerBill <bill@gingerbill.org> | 2020-03-12 14:40:13 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-03-12 14:40:13 +0000 |
| commit | 2a2d3273eae791c5c21eb77374f4818c2a76ae1b (patch) | |
| tree | e2e2c671932002628752ea7362c04f04cc270e12 /src/check_decl.cpp | |
| parent | e0a370f8f181d9787312b89bb30da9e638c59584 (diff) | |
Add `@require` for global variables
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |