aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-01-05 13:22:27 +0000
committergingerBill <bill@gingerbill.org>2025-01-05 13:33:06 +0000
commitbca08d3b85f59c35f4eb43731099bc96730b12cd (patch)
treeac247ee6688756e32213bf969ca2b23f8cb9a354 /src/checker.cpp
parent2efe4c2d68f486006e405ba7d30be03ec121ae6c (diff)
Make `-no-dynamic-literals` the default now
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 7e0a64d75..5d3263789 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -542,6 +542,23 @@ gb_internal u64 check_vet_flags(Ast *node) {
return ast_file_vet_flags(file);
}
+gb_internal u64 check_feature_flags(CheckerContext *c, Ast *node) {
+ AstFile *file = c->file;
+ if (file == nullptr &&
+ c->curr_proc_decl &&
+ c->curr_proc_decl->proc_lit) {
+ file = c->curr_proc_decl->proc_lit->file();
+ }
+ if (file == nullptr) {
+ file = node->file();
+ }
+ if (file != nullptr && file->feature_flags_set) {
+ return file->feature_flags;
+ }
+ return 0;
+}
+
+
enum VettedEntityKind {
VettedEntity_Invalid,
@@ -1164,7 +1181,6 @@ gb_internal void init_universal(void) {
add_global_bool_constant("ODIN_NO_BOUNDS_CHECK", build_context.no_bounds_check);
add_global_bool_constant("ODIN_NO_TYPE_ASSERT", build_context.no_type_assert);
add_global_bool_constant("ODIN_DEFAULT_TO_PANIC_ALLOCATOR", bc->ODIN_DEFAULT_TO_PANIC_ALLOCATOR);
- add_global_bool_constant("ODIN_NO_DYNAMIC_LITERALS", bc->no_dynamic_literals);
add_global_bool_constant("ODIN_NO_CRT", bc->no_crt);
add_global_bool_constant("ODIN_USE_SEPARATE_MODULES", bc->use_separate_modules);
add_global_bool_constant("ODIN_TEST", bc->command_kind == Command_test);