diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-06 20:21:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-06 20:21:13 -0500 |
| commit | 8a5d3e2eaf72195993e4932bfda66d08a36c6064 (patch) | |
| tree | 6a09c68ee70d00e97feeae55b213203fbaddc295 /src/ir.cpp | |
| parent | 3abf293a84b4dc052c0d735018db520eade6274b (diff) | |
| parent | 89ffb5819703c81514e4f29d2cadb5b74ea1f840 (diff) | |
| download | zig-8a5d3e2eaf72195993e4932bfda66d08a36c6064.tar.gz zig-8a5d3e2eaf72195993e4932bfda66d08a36c6064.zip | |
Merge pull request #1924 from ziglang/tls
Implement Thread Local Variables
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 3cbbdc8103..02b2b12230 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -5204,6 +5204,10 @@ static IrInstruction *ir_gen_var_decl(IrBuilder *irb, Scope *scope, AstNode *nod add_node_error(irb->codegen, variable_declaration->section_expr, buf_sprintf("cannot set section of local variable '%s'", buf_ptr(variable_declaration->symbol))); } + if (variable_declaration->threadlocal_tok != nullptr) { + add_token_error(irb->codegen, node->owner, variable_declaration->threadlocal_tok, + buf_sprintf("function-local variable '%s' cannot be threadlocal", buf_ptr(variable_declaration->symbol))); + } // Temporarily set the name of the IrExecutable to the VariableDeclaration // so that the struct or enum from the init expression inherits the name. |
