mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-28 05:44:57 +00:00
link_prefix; thread_local; fix link_name for file-scope variables
This commit is contained in:
@@ -116,8 +116,7 @@ enum ProcCallingConvention {
|
||||
};
|
||||
|
||||
enum VarDeclFlag {
|
||||
VarDeclFlag_using = 1<<0,
|
||||
VarDeclFlag_thread_local = 1<<1,
|
||||
VarDeclFlag_using = 1<<0,
|
||||
};
|
||||
|
||||
enum StmtStateFlag {
|
||||
@@ -4650,22 +4649,6 @@ AstNode *parse_stmt(AstFile *f) {
|
||||
}
|
||||
expect_semicolon(f, s);
|
||||
return s;
|
||||
} else if (tag == "thread_local") {
|
||||
AstNode *s = parse_stmt(f);
|
||||
|
||||
if (s->kind == AstNode_ValueDecl) {
|
||||
if (!s->ValueDecl.is_mutable) {
|
||||
syntax_error(token, "`thread_local` may only be applied to variable declarations");
|
||||
}
|
||||
if (f->curr_proc != nullptr) {
|
||||
syntax_error(token, "`thread_local` is only allowed at the file scope");
|
||||
} else {
|
||||
s->ValueDecl.flags |= VarDeclFlag_thread_local;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
syntax_error(token, "`thread_local` may only be applied to a variable declaration");
|
||||
return ast_bad_stmt(f, token, f->curr_token);
|
||||
} else if (tag == "bounds_check") {
|
||||
s = parse_stmt(f);
|
||||
s->stmt_state_flags |= StmtStateFlag_bounds_check;
|
||||
|
||||
Reference in New Issue
Block a user