aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-12 10:38:40 +0100
committergingerBill <bill@gingerbill.org>2018-05-12 10:38:40 +0100
commit7547bc66cf7ec54b0dd65d1cc9148595388cd08f (patch)
tree844675e71ad6626293855540f38918ccc8607099 /src
parent18a9fa735503e96d69efd968c542e490abe69be0 (diff)
Complete remove all non required preload stuff from min dep and only use what is used.
Diffstat (limited to 'src')
-rw-r--r--src/checker.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index cd6239582..da6fe5b9a 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -1195,27 +1195,35 @@ PtrSet<Entity *> generate_minimum_dependency_set(Checker *c, Entity *start) {
str_lit("default_allocator"),
str_lit("make_source_code_location"),
- str_lit("__bounds_check_error"),
- str_lit("__slice_expr_error"),
- str_lit("__dynamic_array_expr_error"),
-
str_lit("__args__"),
str_lit("__type_table"),
+
+ str_lit("Type_Info"),
+ str_lit("Source_Code_Location"),
+ str_lit("Allocator"),
+ str_lit("Context"),
};
for (isize i = 0; i < gb_count_of(required_entities); i++) {
add_dependency_to_map(&map, info, scope_lookup_entity(c->global_scope, required_entities[i]));
}
+ if (!build_context.no_bounds_check) {
+ String bounds_check_entities[] = {
+ str_lit("__bounds_check_error"),
+ str_lit("__slice_expr_error"),
+ str_lit("__dynamic_array_expr_error"),
+ };
+ for (isize i = 0; i < gb_count_of(bounds_check_entities); i++) {
+ add_dependency_to_map(&map, info, scope_lookup_entity(c->global_scope, bounds_check_entities[i]));
+ }
+ }
+
for_array(i, info->definitions) {
Entity *e = info->definitions[i];
// if (e->scope->is_global && !is_type_poly_proc(e->type)) { // TODO(bill): is the check enough?
- if (e->scope->is_global) { // TODO(bill): is the check enough?
+ if (e->scope == universal_scope) { // TODO(bill): is the check enough?
if (e->type == nullptr || !is_type_poly_proc(e->type)) {
- if (e->kind == Entity_TypeName) {
- add_dependency_to_map(&map, info, e);
- } else {
- // add_dependency_to_map(&map, info, e);
- }
+ add_dependency_to_map(&map, info, e);
}
} else if (e->kind == Entity_Procedure && e->Procedure.is_export) {
add_dependency_to_map(&map, info, e);