X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FCodeGenDAGPatterns.h;h=e4e8574bbca2de4bbcdcaf7116116dfea2eb62cd;hb=202a7a1e3fa661bf78b98d77de7e2d575facd9ee;hp=b113a59e4a94547178d96e4a5f9b4f777a7cd5d8;hpb=7ed1391ff66012e4963081cfb20b6166e8784f50;p=oota-llvm.git diff --git a/utils/TableGen/CodeGenDAGPatterns.h b/utils/TableGen/CodeGenDAGPatterns.h index b113a59e4a9..e4e8574bbca 100644 --- a/utils/TableGen/CodeGenDAGPatterns.h +++ b/utils/TableGen/CodeGenDAGPatterns.h @@ -257,6 +257,17 @@ public: /// isAlwaysTrue - Return true if this is a noop predicate. bool isAlwaysTrue() const; + bool isImmediatePattern() const { return !getImmCode().empty(); } + + /// getImmediatePredicateCode - Return the code that evaluates this pattern if + /// this is an immediate predicate. It is an error to call this on a + /// non-immediate pattern. + std::string getImmediatePredicateCode() const { + std::string Result = getImmCode(); + assert(!Result.empty() && "Isn't an immediate pattern!"); + return Result; + } + bool operator==(const TreePredicateFn &RHS) const { return PatFragRec == RHS.PatFragRec;