gingerBill преди 4 години
родител
ревизия
2938ec028f
променени са 3 файла, в които са добавени 5 реда и са изтрити 20 реда
  1. 0 4
      src/check_decl.cpp
  2. 1 15
      src/checker.cpp
  3. 4 1
      src/checker.hpp

+ 0 - 4
src/check_decl.cpp

@@ -1343,7 +1343,3 @@ void check_proc_body(CheckerContext *ctx_, Token token, DeclInfo *decl, Type *ty
 		}
 	}
 }
-
-
-
-

+ 1 - 15
src/checker.cpp

@@ -4089,20 +4089,7 @@ void check_import_entities(Checker *c) {
 			auto path = find_import_path(c, pkg, pkg, &visited);
 			defer (array_free(&path));
 
-			// TODO(bill): This needs better TokenPos finding
-			auto const fn = [](ImportPathItem item) -> String {
-				return item.pkg->name;
-			};
-
-		#if 1
-			if (path.count == 1) {
-				// TODO(bill): Should this be allowed or disabled?
-			#if 0
-				ImportPathItem item = path[0];
-				String filename = fn(item);
-				error(item.decl, "Self importation of '%.*s'", LIT(filename));
-			#endif
-			} else if (path.count > 0) {
+			if (path.count > 1) {
 				ImportPathItem item = path[path.count-1];
 				String pkg_name = item.pkg->name;
 				error(item.decl, "Cyclic importation of '%.*s'", LIT(pkg_name));
@@ -4113,7 +4100,6 @@ void check_import_entities(Checker *c) {
 				}
 				error(item.decl, "'%.*s'", LIT(pkg_name));
 			}
-		#endif
 		}
 
 		for_array(i, n->pred.entries) {

+ 4 - 1
src/checker.hpp

@@ -295,7 +295,10 @@ struct CheckerInfo {
 	// NOTE(bill): If the semantic checker (check_proc_body) is to ever to be multithreaded,
 	// these variables will be of contention
 
-	BlockingMutex deps_mutex;  // NOT recursive & Only used in `check_proc_body`
+	// NOT recursive & Only used at the end of `check_proc_body`
+	// This is a possible source of contention but probably not
+	// too much of a problem in practice
+	BlockingMutex deps_mutex;
 
 	gbMutex gen_procs_mutex;         // Possibly recursive
 	gbMutex gen_types_mutex;         // Possibly recursive