Remove a few TODOs

This commit is contained in:
gingerBill
2022-12-22 13:03:34 +00:00
parent ffa14c3aad
commit 00823ca88c
5 changed files with 7 additions and 24 deletions
+1 -2
View File
@@ -394,7 +394,7 @@ gb_global TargetMetrics target_darwin_arm64 = {
TargetArch_arm64,
8, 8, 16,
str_lit("arm64-apple-macosx11.0.0"),
str_lit("e-m:o-i64:64-i128:128-n32:64-S128"), // TODO(bill): Is this correct?
str_lit("e-m:o-i64:64-i128:128-n32:64-S128"),
};
gb_global TargetMetrics target_freebsd_i386 = {
@@ -585,7 +585,6 @@ struct LibraryCollections {
gb_global Array<LibraryCollections> library_collections = {0};
gb_internal void add_library_collection(String name, String path) {
// TODO(bill): Check the path is valid and a directory
LibraryCollections lc = {name, string_trim_whitespace(path)};
array_add(&library_collections, lc);
}
+2 -5
View File
@@ -89,7 +89,6 @@ gb_internal void check_or_else_split_types(CheckerContext *c, Operand *x, String
gb_internal void check_or_else_expr_no_value_error(CheckerContext *c, String const &name, Operand const &x, Type *type_hint) {
// TODO(bill): better error message
gbString t = type_to_string(x.type);
error(x.expr, "'%.*s' does not return a value, value is of type %s", LIT(name), t);
if (is_type_union(type_deref(x.type))) {
@@ -2559,7 +2558,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
if (is_type_struct(type)) {
isize variable_count = type->Struct.fields.count;
slice_init(&tuple->Tuple.variables, a, variable_count);
// TODO(bill): Should I copy each of the entities or is this good enough?
// NOTE(bill): don't copy the entities, this should be good enough
gb_memmove_array(tuple->Tuple.variables.data, type->Struct.fields.data, variable_count);
} else if (is_type_array(type)) {
isize variable_count = cast(isize)type->Array.count;
@@ -3766,9 +3765,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
mp_err err = mp_pack(rop, max_count, &written, MP_LSB_FIRST, size, endian, nails, &x.value.value_integer);
GB_ASSERT(err == MP_OKAY);
if (id == BuiltinProc_reverse_bits) {
// TODO(bill): Should this even be allowed at compile time?
} else {
if (id != BuiltinProc_reverse_bits) {
u64 v = 0;
switch (id) {
case BuiltinProc_count_ones:
-8
View File
@@ -10,7 +10,6 @@ gb_internal Type *check_init_variable(CheckerContext *ctx, Entity *e, Operand *o
gbString expr_str = expr_to_string(operand->expr);
// TODO(bill): is this a good enough error message?
// TODO(bill): Actually allow built in procedures to be passed around and thus be created on use
error(operand->expr,
"Cannot assign built-in procedure '%s' in %.*s",
expr_str,
@@ -122,13 +121,6 @@ gb_internal void check_init_variables(CheckerContext *ctx, Entity **lhs, isize l
check_unpack_arguments(ctx, lhs, lhs_count, &operands, inits, true, false);
isize rhs_count = operands.count;
for_array(i, operands) {
if (operands[i].mode == Addressing_Invalid) {
// TODO(bill): Should I ignore invalid parameters?
// rhs_count--;
}
}
isize max = gb_min(lhs_count, rhs_count);
for (isize i = 0; i < max; i++) {
Entity *e = lhs[i];
+2 -7
View File
@@ -404,7 +404,6 @@ gb_internal void scope_lookup_parent(Scope *scope, String const &name, Scope **s
if (found) {
Entity *e = *found;
if (gone_thru_proc) {
// IMPORTANT TODO(bill): Is this correct?!
if (e->kind == Entity_Label) {
continue;
}
@@ -1409,8 +1408,7 @@ gb_internal isize type_info_index(CheckerInfo *info, Type *type, bool error_on_f
entry_index = *found_entry_index;
}
if (entry_index < 0) {
// NOTE(bill): Do manual search
// TODO(bill): This is O(n) and can be very slow
// NOTE(bill): Do manual linear search
for (auto const &e : info->type_info_map) {
if (are_types_identical_unique_tuples(e.key, type)) {
entry_index = e.value;
@@ -2350,7 +2348,7 @@ gb_internal void generate_minimum_dependency_set(Checker *c, Entity *start) {
for_array(i, c->info.definitions) {
Entity *e = c->info.definitions[i];
if (e->scope == builtin_pkg->scope) { // TODO(bill): is the check enough?
if (e->scope == builtin_pkg->scope) {
if (e->type == nullptr) {
add_dependency_to_set(c, e);
}
@@ -3965,7 +3963,6 @@ gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &n
if (curr_file == nullptr) {
error(decl, "import declarations are only allowed in the file scope");
// NOTE(bill): _Should_ be caught by the parser
// TODO(bill): Better error handling if it isn't
continue;
}
// Will be handled later
@@ -3976,7 +3973,6 @@ gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &n
if ((c->scope->flags&ScopeFlag_File) == 0) {
error(decl, "%.*s declarations are only allowed in the file scope", LIT(fl->token.string));
// NOTE(bill): _Should_ be caught by the parser
// TODO(bill): Better error handling if it isn't
continue;
}
check_add_foreign_import_decl(c, decl);
@@ -4167,7 +4163,6 @@ gb_internal void add_import_dependency_node(Checker *c, Ast *decl, PtrMap<AstPac
GB_ASSERT(found_node != nullptr);
n = *found_node;
// TODO(bill): How should the edges be attached for 'import'?
import_graph_node_set_add(&n->succ, m);
import_graph_node_set_add(&m->pred, n);
ptr_set_add(&m->scope->imported, n->scope);
+2 -2
View File
@@ -390,7 +390,7 @@ struct CheckerContext {
// Order doesn't matter after this
u32 state_flags;
bool in_defer; // TODO(bill): Actually handle correctly
bool in_defer;
Type * type_hint;
String proc_name;
@@ -401,7 +401,7 @@ struct CheckerContext {
ForeignContext foreign_context;
CheckerTypePath *type_path;
isize type_level; // TODO(bill): Actually handle correctly
isize type_level;
UntypedExprInfoMap *untyped;