summaryrefslogtreecommitdiff
path: root/src/expr/node_value.cpp
diff options
context:
space:
mode:
authorTim King <taking@google.com>2016-11-10 15:22:49 -0800
committerTim King <taking@google.com>2016-11-10 15:22:49 -0800
commit16e809f698060645812667925b3e0c4d403ee71a (patch)
tree6952e767825c1d99166e1308c39aece2cc9c33c9 /src/expr/node_value.cpp
parent13be3be39454a3cf7b05c4399a53bd2dd27996f6 (diff)
Adding garbage collection of nodes with maxed out reference counts.
Diffstat (limited to 'src/expr/node_value.cpp')
-rw-r--r--src/expr/node_value.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/expr/node_value.cpp b/src/expr/node_value.cpp
index a40075ca9..40649ef2c 100644
--- a/src/expr/node_value.cpp
+++ b/src/expr/node_value.cpp
@@ -37,7 +37,8 @@ namespace expr {
string NodeValue::toString() const {
stringstream ss;
- OutputLanguage outlang = (this == &null()) ? language::output::LANG_AUTO : options::outputLanguage();
+ OutputLanguage outlang = (this == &null()) ? language::output::LANG_AUTO
+ : options::outputLanguage();
toStream(ss, -1, false, false, outlang);
return ss.str();
}
@@ -49,7 +50,8 @@ void NodeValue::toStream(std::ostream& out, int toDepth, bool types, size_t dag,
// count, even just for printing.
RefCountGuard guard(this);
- Printer::getPrinter(language)->toStream(out, TNode(this), toDepth, types, dag);
+ Printer::getPrinter(language)->toStream(out, TNode(this), toDepth, types,
+ dag);
}
void NodeValue::printAst(std::ostream& out, int ind) const {
@@ -58,14 +60,14 @@ void NodeValue::printAst(std::ostream& out, int ind) const {
indent(out, ind);
out << '(';
out << getKind();
- if(getMetaKind() == kind::metakind::VARIABLE) {
+ if (getMetaKind() == kind::metakind::VARIABLE) {
out << ' ' << getId();
- } else if(getMetaKind() == kind::metakind::CONSTANT) {
+ } else if (getMetaKind() == kind::metakind::CONSTANT) {
out << ' ';
kind::metakind::NodeValueConstPrinter::toStream(out, this);
} else {
- if(nv_begin() != nv_end()) {
- for(const_nv_iterator child = nv_begin(); child != nv_end(); ++child) {
+ if (nv_begin() != nv_end()) {
+ for (const_nv_iterator child = nv_begin(); child != nv_end(); ++child) {
out << std::endl;
(*child)->printAst(out, ind + 1);
}
@@ -76,5 +78,5 @@ void NodeValue::printAst(std::ostream& out, int ind) const {
out << ')';
}
-}/* CVC4::expr namespace */
-}/* CVC4 namespace */
+} /* CVC4::expr namespace */
+} /* CVC4 namespace */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback