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;
}
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;
// for all subexpressions, so it isn't useful to traverse and
// increment again (they'll be dagified anyway).
return current.isVar() ||
- current.isConst() ||
+ current.getMetaKind() == kind::metakind::CONSTANT ||
( ( current.getKind() == kind::NOT ||
current.getKind() == kind::UMINUS ) &&
( current[0].isVar() ||
- current[0].isConst() ) ) ||
+ current[0].getMetaKind() == kind::metakind::CONSTANT ) ) ||
current.getKind() == kind::SORT_TYPE ||
d_nodeCount[current] > d_threshold;
}