aboutsummaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/lexer.ll3
-rw-r--r--boot/name_analysis.cc1
-rw-r--r--boot/parser.yy11
3 files changed, 15 insertions, 0 deletions
diff --git a/boot/lexer.ll b/boot/lexer.ll
index 89eb4ed..1cccd35 100644
--- a/boot/lexer.ll
+++ b/boot/lexer.ll
@@ -134,6 +134,9 @@ const {
var {
return yy::parser::make_VAR(this->location);
}
+threadvar {
+ return yy::parser::make_THREADVAR(this->location);
+}
type {
return yy::parser::make_TYPE(this->location);
}
diff --git a/boot/name_analysis.cc b/boot/name_analysis.cc
index d5b2e91..8820684 100644
--- a/boot/name_analysis.cc
+++ b/boot/name_analysis.cc
@@ -1419,6 +1419,7 @@ namespace elna::boot
variable_symbol->alignment =
evaluate_attributes<attribute_kind::aligned>(variable_identifier.attributes).alignment;
variable_symbol->value = computed;
+ variable_symbol->is_thread_local = declaration->is_thread_local;
}
}
diff --git a/boot/parser.yy b/boot/parser.yy
index 68af60e..ab386fe 100644
--- a/boot/parser.yy
+++ b/boot/parser.yy
@@ -100,6 +100,7 @@ along with GCC; see the file COPYING3. If not see
NIL "nil"
CONST "const"
VAR "var"
+ THREADVAR "threadvar"
PROCEDURE "proc"
TYPE "type"
RECORD "record"
@@ -191,6 +192,16 @@ module_declaration:
$$.insert($$.end(), variables.begin(), variables.end());
}
+ | "threadvar" variable_declarations
+ {
+ std::vector<boot::variable_declaration *> variables = $2;
+
+ for (boot::variable_declaration *const variable : variables)
+ {
+ variable->is_thread_local = true;
+ }
+ $$.insert($$.end(), variables.begin(), variables.end());
+ }
| procedure_declaration { $$.emplace_back($1); }
module_declarations:
%empty {}