summaryrefslogtreecommitdiff
path: root/src/expr/expr_manager_template.cpp
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-01-08 16:44:57 -0800
committerTim King <taking@google.com>2016-01-08 16:44:57 -0800
commitf4ef7af0a2295691f281ee1604dfeb4082fe229c (patch)
tree995e512e5669cec6bbc9447d00ec912d5e4c19e3 /src/expr/expr_manager_template.cpp
parentdef0a07f9676a292a849d7fc8269ffd0901ce156 (diff)
Removing StatisticsRegistry's static functions current() and registerStat().
- The functionality the get the StatisticsRegistry attached to the SmtEngine was previously through StatisticsRegistry::current(). This is the dominant StatisticsRegistry in the code. (There is another StatisticsRegistry attached to the NodeManager.) Having this be a static function on StatisticsRegistry requires the use of an SmtEngine in the wrong compilation unit. - Usages of StatisticsRegistry::current() that were visible in prop/{bvminisat,minisat} has been removed. A pointer to the relevant StatisticsRegistry should be passed instead into the constructor. - The function StatisticsRegistry::current() has been replaced by SmtScope::currentStatisticsRegistry(). SmtScope is in the libcvc4 package, where SmtEngine is available in the compilation unit. - The function smtStatisticsRegistry() is a synonym for SmtScope::currentStatisticsRegistry() in smt/smt_statistics_registry.h. This header has fewer include dependencies than the one for SmtScope. - Correspondingly, the static functions StatisticsRegistry::{registerStat, unregisterStat} have been removed. One should instead use smtStatisticsRegistry()->{registerStat,unregisterStat} instead. - The KEEP_STATISTIC macro has been moved into smt/smt_statistics_registry.h. - Documents the reason StatisticsRegistry is CVC4_PUBLIC. This lets me remove the warning I added. - Removing most operators for timespec from statistics_registry.h file. These a bit error prone in clang. - Most of the really confusing ifdef's in util/statistics_registry.h are gone.
Diffstat (limited to 'src/expr/expr_manager_template.cpp')
-rw-r--r--src/expr/expr_manager_template.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/expr/expr_manager_template.cpp b/src/expr/expr_manager_template.cpp
index 59f423e3c..0b9557cc8 100644
--- a/src/expr/expr_manager_template.cpp
+++ b/src/expr/expr_manager_template.cpp
@@ -19,9 +19,9 @@
#include <map>
#include "expr/node_manager.h"
-#include "expr/statistics_registry.h"
#include "expr/variable_type_map.h"
#include "options/options.h"
+#include "util/statistics_registry.h"
${includes}
@@ -38,7 +38,7 @@ ${includes}
stringstream statName; \
statName << "expr::ExprManager::" << kind; \
d_exprStatistics[kind] = new IntStat(statName.str(), 0); \
- d_nodeManager->getStatisticsRegistry()->registerStat_(d_exprStatistics[kind]); \
+ d_nodeManager->getStatisticsRegistry()->registerStat(d_exprStatistics[kind]); \
} \
++ *(d_exprStatistics[kind]); \
}
@@ -54,7 +54,7 @@ ${includes}
statName << "expr::ExprManager::" << ((bound_var) ? "BOUND_VARIABLE" : "VARIABLE") << ":" << type; \
} \
d_exprStatisticsVars[type] = new IntStat(statName.str(), 0); \
- d_nodeManager->getStatisticsRegistry()->registerStat_(d_exprStatisticsVars[type]); \
+ d_nodeManager->getStatisticsRegistry()->registerStat(d_exprStatisticsVars[type]); \
} \
++ *(d_exprStatisticsVars[type]); \
}
@@ -100,14 +100,14 @@ ExprManager::~ExprManager() throw() {
#ifdef CVC4_STATISTICS_ON
for (unsigned i = 0; i < kind::LAST_KIND; ++ i) {
if (d_exprStatistics[i] != NULL) {
- d_nodeManager->getStatisticsRegistry()->unregisterStat_(d_exprStatistics[i]);
+ d_nodeManager->getStatisticsRegistry()->unregisterStat(d_exprStatistics[i]);
delete d_exprStatistics[i];
d_exprStatistics[i] = NULL;
}
}
for (unsigned i = 0; i < LAST_TYPE; ++ i) {
if (d_exprStatisticsVars[i] != NULL) {
- d_nodeManager->getStatisticsRegistry()->unregisterStat_(d_exprStatisticsVars[i]);
+ d_nodeManager->getStatisticsRegistry()->unregisterStat(d_exprStatisticsVars[i]);
delete d_exprStatisticsVars[i];
d_exprStatisticsVars[i] = NULL;
}
@@ -123,10 +123,6 @@ ExprManager::~ExprManager() throw() {
}
}
-StatisticsRegistry* ExprManager::getStatisticsRegistry() throw() {
- return d_nodeManager->getStatisticsRegistry();
-}
-
const Options& ExprManager::getOptions() const {
return d_nodeManager->getOptions();
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback