ValueFlow: Changed --debug output so we can see if a variable is known or possible
This commit is contained in:
parent
7f9a313b94
commit
9197e70a8d
|
@ -1311,8 +1311,11 @@ void Token::printValueFlow(bool xml, std::ostream &out) const
|
||||||
else if (line != tok->linenr())
|
else if (line != tok->linenr())
|
||||||
out << "Line " << tok->linenr() << std::endl;
|
out << "Line " << tok->linenr() << std::endl;
|
||||||
line = tok->linenr();
|
line = tok->linenr();
|
||||||
if (!xml)
|
if (!xml) {
|
||||||
out << " " << tok->str() << ":{";
|
out << " " << tok->str() << ' ' << (tok->values.front().isKnown() ? "= " : ": ");
|
||||||
|
if (tok->values.size() > 1U)
|
||||||
|
out << '{';
|
||||||
|
}
|
||||||
for (std::list<ValueFlow::Value>::const_iterator it=tok->values.begin(); it!=tok->values.end(); ++it) {
|
for (std::list<ValueFlow::Value>::const_iterator it=tok->values.begin(); it!=tok->values.end(); ++it) {
|
||||||
if (xml) {
|
if (xml) {
|
||||||
out << " <value ";
|
out << " <value ";
|
||||||
|
@ -1322,6 +1325,10 @@ void Token::printValueFlow(bool xml, std::ostream &out) const
|
||||||
out << "intvalue=\"" << it->intvalue << '\"';
|
out << "intvalue=\"" << it->intvalue << '\"';
|
||||||
if (it->condition)
|
if (it->condition)
|
||||||
out << " condition-line=\"" << it->condition->linenr() << '\"';
|
out << " condition-line=\"" << it->condition->linenr() << '\"';
|
||||||
|
if (it->isKnown())
|
||||||
|
out << " known=\"true\"";
|
||||||
|
else if (it->isPossible())
|
||||||
|
out << " possible=\"true\"";
|
||||||
out << "/>" << std::endl;
|
out << "/>" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1336,8 +1343,10 @@ void Token::printValueFlow(bool xml, std::ostream &out) const
|
||||||
}
|
}
|
||||||
if (xml)
|
if (xml)
|
||||||
out << " </values>" << std::endl;
|
out << " </values>" << std::endl;
|
||||||
|
else if (tok->values.size() > 1U)
|
||||||
|
out << '}' << std::endl;
|
||||||
else
|
else
|
||||||
out << "}" << std::endl;
|
out << std::endl;
|
||||||
}
|
}
|
||||||
if (xml)
|
if (xml)
|
||||||
out << " </valueflow>" << std::endl;
|
out << " </valueflow>" << std::endl;
|
||||||
|
|
Loading…
Reference in New Issue