summaryrefslogtreecommitdiff
path: root/src/smt
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2021-04-06 09:33:52 -0700
committerGitHub <noreply@github.com>2021-04-06 16:33:52 +0000
commitcfe1431aaae7366dea1d3124742ee2b2c2a2511e (patch)
tree7c30457bef5857947102636bddc8cc3a05e9e3c5 /src/smt
parente92b4504d5930234c852bf0fba8f5663ad4809e7 (diff)
Remove template argument from `NodeBuilder` (#6290)
Currently, NodeBuilder takes a single template argument: An integer that determines the expected number of arguments. This argument is used to determine the size of the d_inlineNvChildSpace array. This array is used to construct nodes inline. The advantage of this is that we don't have to allocate a NodeValue on the heap for the node under construction until we are sure that the node is new. While templating the array size may save some stack space (or avoid a heap allocation if we statically know that we a fixed number of children and that number is greater than 10), it complicates the code and leads to longer compile times. Thus, this commit removes the template argument and moves some of the NodeBuilder code to a source file for faster compilation. CPU build time before change (debug build): 2429.68s CPU build time after change (debug build): 2228.44s Signed-off-by: Andres Noetzli noetzli@amazon.com
Diffstat (limited to 'src/smt')
-rw-r--r--src/smt/assertions.cpp1
-rw-r--r--src/smt/dump.cpp1
-rw-r--r--src/smt/expand_definitions.cpp2
-rw-r--r--src/smt/preprocessor.cpp1
-rw-r--r--src/smt/smt_engine.cpp1
5 files changed, 5 insertions, 1 deletions
diff --git a/src/smt/assertions.cpp b/src/smt/assertions.cpp
index 07d072751..bfb14e2c4 100644
--- a/src/smt/assertions.cpp
+++ b/src/smt/assertions.cpp
@@ -18,6 +18,7 @@
#include "expr/node_algorithm.h"
#include "options/base_options.h"
+#include "options/expr_options.h"
#include "options/language.h"
#include "options/smt_options.h"
#include "proof/proof_manager.h"
diff --git a/src/smt/dump.cpp b/src/smt/dump.cpp
index e00ed907f..c1daf9879 100644
--- a/src/smt/dump.cpp
+++ b/src/smt/dump.cpp
@@ -19,6 +19,7 @@
#include "base/configuration.h"
#include "base/output.h"
#include "lib/strtok_r.h"
+#include "options/option_exception.h"
#include "preprocessing/preprocessing_pass_registry.h"
#include "smt/command.h"
#include "smt/node_command.h"
diff --git a/src/smt/expand_definitions.cpp b/src/smt/expand_definitions.cpp
index 85a2732c9..59597b97f 100644
--- a/src/smt/expand_definitions.cpp
+++ b/src/smt/expand_definitions.cpp
@@ -294,7 +294,7 @@ TrustNode ExpandDefs::expandDefinitions(
if (node.getNumChildren() > 0)
{
// cout << "cons : " << node << std::endl;
- NodeBuilder<> nb(node.getKind());
+ NodeBuilder nb(node.getKind());
if (node.getMetaKind() == metakind::PARAMETERIZED)
{
Debug("expand") << "op : " << node.getOperator() << std::endl;
diff --git a/src/smt/preprocessor.cpp b/src/smt/preprocessor.cpp
index 9f1f71bd7..28f393704 100644
--- a/src/smt/preprocessor.cpp
+++ b/src/smt/preprocessor.cpp
@@ -14,6 +14,7 @@
#include "smt/preprocessor.h"
+#include "options/expr_options.h"
#include "options/smt_options.h"
#include "preprocessing/preprocessing_pass_context.h"
#include "printer/printer.h"
diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp
index d7c44fef3..a925c04ab 100644
--- a/src/smt/smt_engine.cpp
+++ b/src/smt/smt_engine.cpp
@@ -24,6 +24,7 @@
#include "expr/bound_var_manager.h"
#include "expr/node.h"
#include "options/base_options.h"
+#include "options/expr_options.h"
#include "options/language.h"
#include "options/main_options.h"
#include "options/printer_options.h"
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback