aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-02-23 22:17:27 +0000
committergingerBill <bill@gingerbill.org>2019-02-23 22:17:27 +0000
commita9ab90bd2488783c3523fa30315f9754937fd52e (patch)
tree17c7e5398a7b95f106ccece88f709c0887750837 /src/ir.cpp
parente551d2b25ea39afb95f7b8ee4309ef0cc8b502b8 (diff)
Make `static` an attribute rather than a keyword prefix
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 4df6665f7..e92fa7f60 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -8166,7 +8166,16 @@ void ir_build_stmt_internal(irProcedure *proc, Ast *node) {
if (vd->is_mutable) {
irModule *m = proc->module;
- if (vd->is_static) {
+ bool is_static = false;
+ if (vd->names.count > 0) {
+ Entity *e = entity_of_ident(vd->names[0]);
+ if (e->flags & EntityFlag_Static) {
+ // NOTE(bill): If one of the entities is static, they all are
+ is_static = true;
+ }
+ }
+
+ if (is_static) {
for_array(i, vd->names) {
irValue *value = nullptr;
if (vd->values.count > 0) {