Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tristan0x/sonar source fixes #1083

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/ast/ast_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
#include "symtab/symbol_table.hpp"
#include "visitors/visitor.hpp"

namespace nmodl {

/// Abstract Syntax Tree (AST) related implementations
namespace ast {
namespace nmodl::ast {

/**
* @defgroup ast AST Implementation
Expand Down Expand Up @@ -96,5 +94,4 @@ static const std::string ReactionOpNames[] = {"<->", "<<", "->"};

/** @} */ // end of ast_prop

} // namespace ast
} // namespace nmodl
} // namespace nmodl::ast
6 changes: 2 additions & 4 deletions src/codegen/codegen_acc_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
#include "ast/protect_statement.hpp"


namespace nmodl {
namespace codegen {
namespace nmodl::codegen {

/****************************************************************************************/
/* Routines must be overloaded in backend */
Expand Down Expand Up @@ -376,5 +375,4 @@ void CodegenAccVisitor::print_dt_update_to_device() const {
get_variable_name(naming::NTHREAD_DT_VARIABLE));
}

} // namespace codegen
} // namespace nmodl
} // namespace nmodl::codegen
12 changes: 5 additions & 7 deletions src/codegen/codegen_acc_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#include "codegen/codegen_cpp_visitor.hpp"


namespace nmodl {
namespace codegen {
namespace nmodl::codegen {

/**
* \addtogroup codegen_backends
Expand Down Expand Up @@ -116,13 +115,13 @@ class CodegenAccVisitor: public CodegenCppVisitor {
void print_net_send_buf_update_to_host() const override;

/// update NetSendBuffer_t count from host to device
virtual void print_net_send_buf_count_update_to_device() const override;
void print_net_send_buf_count_update_to_device() const override;

/// update dt from host to device
virtual void print_dt_update_to_device() const override;
void print_dt_update_to_device() const override;

// synchronise/wait on stream specific to NrnThread
virtual void print_device_stream_wait() const override;
void print_device_stream_wait() const override;

/// print atomic capture pragma
void print_device_atomic_capture_annotation() const override;
Expand Down Expand Up @@ -151,5 +150,4 @@ class CodegenAccVisitor: public CodegenCppVisitor {

/** \} */ // end of codegen_backends

} // namespace codegen
} // namespace nmodl
} // namespace nmodl::codegen
11 changes: 4 additions & 7 deletions src/codegen/codegen_compatibility_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
#include "utils/logger.hpp"
#include "visitors/visitor_utils.hpp"


namespace nmodl {
namespace codegen {
namespace nmodl::codegen {

const std::map<ast::AstNodeType, CodegenCompatibilityVisitor::FunctionPointer>
CodegenCompatibilityVisitor::unhandled_ast_types_func(
Expand Down Expand Up @@ -101,7 +99,7 @@ std::string CodegenCompatibilityVisitor::return_error_if_no_bbcore_read_write(
parser::CDriver driver;

driver.scan_string(verbatim_statement_string);
auto tokens = driver.all_tokens();
const auto& tokens = driver.all_tokens();

for (const auto& token: tokens) {
if (token == "bbcore_read") {
Expand Down Expand Up @@ -132,7 +130,7 @@ std::string CodegenCompatibilityVisitor::return_error_if_no_bbcore_read_write(
bool CodegenCompatibilityVisitor::find_unhandled_ast_nodes(Ast& node) const {
std::vector<ast::AstNodeType> unhandled_ast_types;
unhandled_ast_types.reserve(unhandled_ast_types_func.size());
for (auto [node_type, _]: unhandled_ast_types_func) {
for (const auto& [node_type, _]: unhandled_ast_types_func) {
unhandled_ast_types.push_back(node_type);
}
const auto& unhandled_ast_nodes = collect_nodes(node, unhandled_ast_types);
Expand All @@ -158,5 +156,4 @@ bool CodegenCompatibilityVisitor::find_unhandled_ast_nodes(Ast& node) const {
return false;
}

} // namespace codegen
} // namespace nmodl
} // namespace nmodl::codegen
6 changes: 2 additions & 4 deletions src/codegen/codegen_compatibility_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
#include "utils/logger.hpp"
#include "visitors/ast_visitor.hpp"

namespace nmodl {
namespace codegen {
namespace nmodl::codegen {

using namespace ast;

Expand Down Expand Up @@ -157,5 +156,4 @@ class CodegenCompatibilityVisitor: public visitor::AstVisitor {

/** \} */ // end of codegen_backends

} // namespace codegen
} // namespace nmodl
} // namespace nmodl::codegen
Loading
Loading