diff options
author | Morgan Deters <mdeters@gmail.com> | 2012-08-09 13:48:37 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2012-08-09 13:48:37 +0000 |
commit | ecdd09877ecc4c07a22cc27cd2dd5441134476ba (patch) | |
tree | 31360d8a02df358db3a15a2cb463dfee2fae4d98 /src/expr/node.h | |
parent | 2a8c2250a4cf3cd2c5d806678c31a1c98f72323d (diff) |
minor isConst()-related fixes to printing; also add some debugging stuff to see how isConst() operates: use -d isConst
Diffstat (limited to 'src/expr/node.h')
-rw-r--r-- | src/expr/node.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/expr/node.h b/src/expr/node.h index b5186f2ed..0ce042654 100644 --- a/src/expr/node.h +++ b/src/expr/node.h @@ -1271,7 +1271,7 @@ template <bool ref_count> inline bool NodeTemplate<ref_count>::isConst() const { assertTNodeNotExpired(); - Debug("isConst") << "Node::isConst() for " << getKind() << " with " << getNumChildren() << " children" << std::endl; + Debug("isConst") << "Node::isConst() for: " << *this << std::endl; if(isNull()) { return false; } @@ -1285,11 +1285,11 @@ NodeTemplate<ref_count>::isConst() const { default: if(getAttribute(IsConstComputedAttr())) { bool bval = getAttribute(IsConstAttr()); - Debug("isConst") << "Node::isConst() returning cached value " << bval << std::endl; + Debug("isConst") << "Node::isConst() returning cached value " << (bval ? "true" : "false") << " for: " << *this << std::endl; return bval; } else { bool bval = expr::TypeChecker::computeIsConst(NodeManager::currentNM(), *this); - Debug("isConst") << "Node::isConst() computed value " << bval << std::endl; + Debug("isConst") << "Node::isConst() computed value " << (bval ? "true" : "false") << " for: " << *this << std::endl; const_cast< NodeTemplate<ref_count>* >(this)->setAttribute(IsConstAttr(), bval); const_cast< NodeTemplate<ref_count>* >(this)->setAttribute(IsConstComputedAttr(), true); return bval; |