summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/DAGISelMatcher.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-04-17 21:38:24 +0000
committerChris Lattner <sabre@nondot.org>2011-04-17 21:38:24 +0000
commit514e292b725c1c2583f833152b2c0e550e67f153 (patch)
tree48600624905b8a9e6ea17fe314ac357cc14b757b /llvm/utils/TableGen/DAGISelMatcher.h
parentc58f8cb7fc76ca4273f715223f31bba36f6c3673 (diff)
downloadbcm5719-llvm-514e292b725c1c2583f833152b2c0e550e67f153.tar.gz
bcm5719-llvm-514e292b725c1c2583f833152b2c0e550e67f153.zip
Rework our internal representation of node predicates to expose more
structure and fix some fixmes. We now have a TreePredicateFn class that handles all of the decoding of these things. This is an internal cleanup that has no impact on the code generated by tblgen. llvm-svn: 129670
Diffstat (limited to 'llvm/utils/TableGen/DAGISelMatcher.h')
-rw-r--r--llvm/utils/TableGen/DAGISelMatcher.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcher.h b/llvm/utils/TableGen/DAGISelMatcher.h
index 8ffe412aca3..dcb8da71086 100644
--- a/llvm/utils/TableGen/DAGISelMatcher.h
+++ b/llvm/utils/TableGen/DAGISelMatcher.h
@@ -25,6 +25,8 @@ namespace llvm {
class ComplexPattern;
class Record;
class SDNodeInfo;
+ class TreePredicateFn;
+ class TreePattern;
Matcher *ConvertPatternToMatcher(const PatternToMatch &Pattern,unsigned Variant,
const CodeGenDAGPatterns &CGP);
@@ -419,12 +421,11 @@ private:
/// CheckPredicateMatcher - This checks the target-specific predicate to
/// see if the node is acceptable.
class CheckPredicateMatcher : public Matcher {
- StringRef PredName;
+ TreePattern *Pred;
public:
- CheckPredicateMatcher(StringRef predname)
- : Matcher(CheckPredicate), PredName(predname) {}
+ CheckPredicateMatcher(const TreePredicateFn &pred);
- StringRef getPredicateName() const { return PredName; }
+ TreePredicateFn getPredicate() const;
static inline bool classof(const Matcher *N) {
return N->getKind() == CheckPredicate;
@@ -436,7 +437,7 @@ public:
private:
virtual void printImpl(raw_ostream &OS, unsigned indent) const;
virtual bool isEqualImpl(const Matcher *M) const {
- return cast<CheckPredicateMatcher>(M)->PredName == PredName;
+ return cast<CheckPredicateMatcher>(M)->Pred == Pred;
}
virtual unsigned getHashImpl() const;
};
OpenPOWER on IntegriCloud