From c35d22e73fb17106bfafbed519d8c06b0b14f79e Mon Sep 17 00:00:00 2001 From: Goran Jelic-Cizmek Date: Tue, 18 Jun 2024 13:29:43 +0200 Subject: [PATCH] Make thread-unsafe warnings more specific --- src/codegen/codegen_cpp_visitor.cpp | 5 ----- src/codegen/codegen_helper_visitor.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/codegen/codegen_cpp_visitor.cpp b/src/codegen/codegen_cpp_visitor.cpp index 711fff48b..c6f7521b3 100644 --- a/src/codegen/codegen_cpp_visitor.cpp +++ b/src/codegen/codegen_cpp_visitor.cpp @@ -1359,11 +1359,6 @@ void CodegenCppVisitor::setup(const Program& node) { } info.rsuffix = info.point_process ? "" : "_" + info.mod_suffix; - if (!info.vectorize) { - logger->warn( - "CodegenCoreneuronCppVisitor : MOD file uses non-thread safe constructs of NMODL"); - } - codegen_float_variables = get_float_variables(); codegen_int_variables = get_int_variables(); diff --git a/src/codegen/codegen_helper_visitor.cpp b/src/codegen/codegen_helper_visitor.cpp index 417eca131..725f649ca 100644 --- a/src/codegen/codegen_helper_visitor.cpp +++ b/src/codegen/codegen_helper_visitor.cpp @@ -13,9 +13,9 @@ #include "ast/all.hpp" #include "codegen/codegen_naming.hpp" #include "parser/c11_driver.hpp" +#include "utils/logger.hpp" #include "visitors/visitor_utils.hpp" - namespace nmodl { namespace codegen { @@ -738,14 +738,19 @@ CodegenInfo CodegenHelperVisitor::analyze(const ast::Program& node) { void CodegenHelperVisitor::visit_linear_block(const ast::LinearBlock& /* node */) { info.vectorize = false; + logger->warn("CodegenHelperVisitor : MOD file uses non-thread safe construct of NMODL: LINEAR"); } void CodegenHelperVisitor::visit_non_linear_block(const ast::NonLinearBlock& /* node */) { info.vectorize = false; + logger->warn( + "CodegenHelperVisitor : MOD file uses non-thread safe construct of NMODL: NONLINEAR"); } void CodegenHelperVisitor::visit_discrete_block(const ast::DiscreteBlock& /* node */) { info.vectorize = false; + logger->warn( + "CodegenHelperVisitor : MOD file uses non-thread safe construct of NMODL: DISCRETE"); } void CodegenHelperVisitor::visit_update_dt(const ast::UpdateDt& node) {