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

Refactor printing FUNCTIONS. #1523

Merged
merged 1 commit into from
Oct 18, 2024
Merged
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
6 changes: 4 additions & 2 deletions src/codegen/codegen_neuron_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2334,8 +2334,7 @@ void CodegenNeuronCppVisitor::print_g_unused() const {
)CODE");
}


void CodegenNeuronCppVisitor::print_compute_functions() {
void CodegenNeuronCppVisitor::print_function_definitions() {
print_hoc_py_wrapper_function_definitions();
for (const auto& procedure: info.procedures) {
print_procedure(*procedure);
Expand All @@ -2346,7 +2345,9 @@ void CodegenNeuronCppVisitor::print_compute_functions() {
for (const auto& function_table: info.function_tables) {
print_function_tables(*function_table);
}
}

void CodegenNeuronCppVisitor::print_compute_functions() {
print_nrn_init();
print_nrn_cur();
print_nrn_state();
Expand Down Expand Up @@ -2377,6 +2378,7 @@ void CodegenNeuronCppVisitor::print_codegen_routines() {
print_functors_definitions();
print_global_variables_for_hoc();
print_thread_memory_callbacks();
print_function_definitions();
print_compute_functions(); // only nrn_cur and nrn_state
print_nrn_constructor();
print_nrn_destructor();
Expand Down
8 changes: 8 additions & 0 deletions src/codegen/codegen_neuron_cpp_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,14 @@ class CodegenNeuronCppVisitor: public CodegenCppVisitor {
void print_function_prototypes() override;


/**
* Print function and procedures prototype definitions.
*
* This includes the HOC/Python wrappers.
*/
void print_function_definitions();


/**
* Print all `check_*` function declarations
*/
Expand Down
Loading