Index: test/unittests/compiler/node-test-utils.cc |
diff --git a/test/unittests/compiler/node-test-utils.cc b/test/unittests/compiler/node-test-utils.cc |
index 18b072909130a1f4456a609095b789b5199589a5..a35e5d1bc77d7103ed9cb56d5b717dce959e1b3a 100644 |
--- a/test/unittests/compiler/node-test-utils.cc |
+++ b/test/unittests/compiler/node-test-utils.cc |
@@ -462,6 +462,37 @@ class IsEffectPhiMatcher FINAL : public NodeMatcher { |
}; |
+class IsEffectSetMatcher FINAL : public NodeMatcher { |
+ public: |
+ IsEffectSetMatcher(const Matcher<Node*>& effect0_matcher, |
+ const Matcher<Node*>& effect1_matcher) |
+ : NodeMatcher(IrOpcode::kEffectSet), |
+ effect0_matcher_(effect0_matcher), |
+ effect1_matcher_(effect1_matcher) {} |
+ |
+ void DescribeTo(std::ostream* os) const FINAL { |
+ NodeMatcher::DescribeTo(os); |
+ *os << "), effect0 ("; |
+ effect0_matcher_.DescribeTo(os); |
+ *os << ") and effect1 ("; |
+ effect1_matcher_.DescribeTo(os); |
+ *os << ")"; |
+ } |
+ |
+ bool MatchAndExplain(Node* node, MatchResultListener* listener) const FINAL { |
+ return (NodeMatcher::MatchAndExplain(node, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetEffectInput(node, 0), |
+ "effect0", effect0_matcher_, listener) && |
+ PrintMatchAndExplain(NodeProperties::GetEffectInput(node, 1), |
+ "effect1", effect1_matcher_, listener)); |
+ } |
+ |
+ private: |
+ const Matcher<Node*> effect0_matcher_; |
+ const Matcher<Node*> effect1_matcher_; |
+}; |
+ |
+ |
class IsProjectionMatcher FINAL : public NodeMatcher { |
public: |
IsProjectionMatcher(const Matcher<size_t>& index_matcher, |
@@ -1148,6 +1179,17 @@ class IsUnopMatcher FINAL : public NodeMatcher { |
private: |
const Matcher<Node*> input_matcher_; |
}; |
+ |
+} // namespace |
+ |
+ |
+Matcher<Node*> IsAlways() { |
+ return MakeMatcher(new NodeMatcher(IrOpcode::kAlways)); |
+} |
+ |
+ |
+Matcher<Node*> IsEnd(const Matcher<Node*>& control_matcher) { |
+ return MakeMatcher(new IsControl1Matcher(IrOpcode::kEnd, control_matcher)); |
} |
@@ -1290,6 +1332,12 @@ Matcher<Node*> IsEffectPhi(const Matcher<Node*>& effect0_matcher, |
} |
+Matcher<Node*> IsEffectSet(const Matcher<Node*>& effect0_matcher, |
+ const Matcher<Node*>& effect1_matcher) { |
+ return MakeMatcher(new IsEffectSetMatcher(effect0_matcher, effect1_matcher)); |
+} |
+ |
+ |
Matcher<Node*> IsProjection(const Matcher<size_t>& index_matcher, |
const Matcher<Node*>& base_matcher) { |
return MakeMatcher(new IsProjectionMatcher(index_matcher, base_matcher)); |