From e39650a805425ffdbd79692c7d1bad80f7332dae Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 16 Feb 2010 06:10:58 +0000 Subject: add support for the new isel matcher to generate (isprofitable|islegal)tofold checks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96331 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/CodeGenDAGPatterns.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'utils/TableGen/CodeGenDAGPatterns.h') diff --git a/utils/TableGen/CodeGenDAGPatterns.h b/utils/TableGen/CodeGenDAGPatterns.h index 5eef9e1ddc..f1f7bca1a8 100644 --- a/utils/TableGen/CodeGenDAGPatterns.h +++ b/utils/TableGen/CodeGenDAGPatterns.h @@ -216,6 +216,13 @@ public: void setChild(unsigned i, TreePatternNode *N) { Children[i] = N; } + + /// hasChild - Return true if N is any of our children. + bool hasChild(const TreePatternNode *N) const { + for (unsigned i = 0, e = Children.size(); i != e; ++i) + if (Children[i] == N) return true; + return false; + } const std::vector &getPredicateFns() const {return PredicateFns;} void clearPredicateFns() { PredicateFns.clear(); } -- cgit v1.2.3-18-g5258