add infrastructure to support forming selectnodeto. Not used yet
because I have to go on another detour first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97362 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/DAGISelMatcher.cpp b/utils/TableGen/DAGISelMatcher.cpp
index 3ea5b5d..d6f4f78 100644
--- a/utils/TableGen/DAGISelMatcher.cpp
+++ b/utils/TableGen/DAGISelMatcher.cpp
@@ -170,8 +170,10 @@
}
-void EmitNodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
- OS.indent(indent) << "EmitNode: " << OpcodeName << ": <todo flags> ";
+void EmitNodeMatcherCommon::printImpl(raw_ostream &OS, unsigned indent) const {
+ OS.indent(indent);
+ OS << (isSelectNodeTo() ? "SelectNodeTo: " : "EmitNode: ")
+ << OpcodeName << ": <todo flags> ";
for (unsigned i = 0, e = VTs.size(); i != e; ++i)
OS << ' ' << getEnumName(VTs[i]);
@@ -236,15 +238,15 @@
return HashUnsigneds(ChainNodes.begin(), ChainNodes.end());
}
-bool EmitNodeMatcher::isEqualImpl(const Matcher *m) const {
- const EmitNodeMatcher *M = cast<EmitNodeMatcher>(m);
+bool EmitNodeMatcherCommon::isEqualImpl(const Matcher *m) const {
+ const EmitNodeMatcherCommon *M = cast<EmitNodeMatcherCommon>(m);
return M->OpcodeName == OpcodeName && M->VTs == VTs &&
M->Operands == Operands && M->HasChain == HasChain &&
M->HasFlag == HasFlag && M->HasMemRefs == HasMemRefs &&
M->NumFixedArityOperands == NumFixedArityOperands;
}
-unsigned EmitNodeMatcher::getHashImpl() const {
+unsigned EmitNodeMatcherCommon::getHashImpl() const {
return (HashString(OpcodeName) << 4) | Operands.size();
}