Commit 1d03fc17 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Remove obsolete helpers from graph verifier.

The NodeProperties helpers are here to stay and won't go away anytime
soon. This removes a TODO from the graph verifier in that regard.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1375923002

Cr-Commit-Position: refs/heads/master@{#31007}
parent 904ac0ae
...@@ -51,11 +51,6 @@ class Verifier::Visitor { ...@@ -51,11 +51,6 @@ class Verifier::Visitor {
Typing typing; Typing typing;
private: private:
// TODO(rossberg): Get rid of these once we got rid of NodeProperties.
Type* type_of(Node* node) { return NodeProperties::GetType(node); }
Node* ValueInput(Node* node, int i = 0) {
return NodeProperties::GetValueInput(node, i);
}
void CheckNotTyped(Node* node) { void CheckNotTyped(Node* node) {
if (NodeProperties::IsTyped(node)) { if (NodeProperties::IsTyped(node)) {
std::ostringstream str; std::ostringstream str;
...@@ -65,35 +60,35 @@ class Verifier::Visitor { ...@@ -65,35 +60,35 @@ class Verifier::Visitor {
} }
} }
void CheckUpperIs(Node* node, Type* type) { void CheckUpperIs(Node* node, Type* type) {
if (typing == TYPED && !type_of(node)->Is(type)) { if (typing == TYPED && !NodeProperties::GetType(node)->Is(type)) {
std::ostringstream str; std::ostringstream str;
str << "TypeError: node #" << node->id() << ":" << *node->op() str << "TypeError: node #" << node->id() << ":" << *node->op()
<< " type "; << " type ";
type_of(node)->PrintTo(str); NodeProperties::GetType(node)->PrintTo(str);
str << " is not "; str << " is not ";
type->PrintTo(str); type->PrintTo(str);
FATAL(str.str().c_str()); FATAL(str.str().c_str());
} }
} }
void CheckUpperMaybe(Node* node, Type* type) { void CheckUpperMaybe(Node* node, Type* type) {
if (typing == TYPED && !type_of(node)->Maybe(type)) { if (typing == TYPED && !NodeProperties::GetType(node)->Maybe(type)) {
std::ostringstream str; std::ostringstream str;
str << "TypeError: node #" << node->id() << ":" << *node->op() str << "TypeError: node #" << node->id() << ":" << *node->op()
<< " type "; << " type ";
type_of(node)->PrintTo(str); NodeProperties::GetType(node)->PrintTo(str);
str << " must intersect "; str << " must intersect ";
type->PrintTo(str); type->PrintTo(str);
FATAL(str.str().c_str()); FATAL(str.str().c_str());
} }
} }
void CheckValueInputIs(Node* node, int i, Type* type) { void CheckValueInputIs(Node* node, int i, Type* type) {
Node* input = ValueInput(node, i); Node* input = NodeProperties::GetValueInput(node, i);
if (typing == TYPED && !type_of(input)->Is(type)) { if (typing == TYPED && !NodeProperties::GetType(input)->Is(type)) {
std::ostringstream str; std::ostringstream str;
str << "TypeError: node #" << node->id() << ":" << *node->op() str << "TypeError: node #" << node->id() << ":" << *node->op()
<< "(input @" << i << " = " << input->opcode() << ":" << "(input @" << i << " = " << input->opcode() << ":"
<< input->op()->mnemonic() << ") type "; << input->op()->mnemonic() << ") type ";
type_of(input)->PrintTo(str); NodeProperties::GetType(input)->PrintTo(str);
str << " is not "; str << " is not ";
type->PrintTo(str); type->PrintTo(str);
FATAL(str.str().c_str()); FATAL(str.str().c_str());
...@@ -425,7 +420,8 @@ void Verifier::Visitor::Check(Node* node) { ...@@ -425,7 +420,8 @@ void Verifier::Visitor::Check(Node* node) {
// TODO(rossberg): what are the constraints on these? // TODO(rossberg): what are the constraints on these?
// Type must be subsumed by input type. // Type must be subsumed by input type.
if (typing == TYPED) { if (typing == TYPED) {
CHECK(type_of(ValueInput(node))->Is(type_of(node))); Node* val = NodeProperties::GetValueInput(node, 0);
CHECK(NodeProperties::GetType(val)->Is(NodeProperties::GetType(node)));
} }
break; break;
} }
...@@ -565,7 +561,7 @@ void Verifier::Visitor::Check(Node* node) { ...@@ -565,7 +561,7 @@ void Verifier::Visitor::Check(Node* node) {
// TODO(rossberg): This should really be Is(Internal), but the typer // TODO(rossberg): This should really be Is(Internal), but the typer
// currently can't do backwards propagation. // currently can't do backwards propagation.
CheckUpperMaybe(context, Type::Internal()); CheckUpperMaybe(context, Type::Internal());
if (typing == TYPED) CHECK(type_of(node)->IsContext()); if (typing == TYPED) CHECK(NodeProperties::GetType(node)->IsContext());
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment