diff options
Diffstat (limited to 'include/llvm/Support/PatternMatch.h')
-rw-r--r-- | include/llvm/Support/PatternMatch.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h index 2408103cb9..f5356a6edd 100644 --- a/include/llvm/Support/PatternMatch.h +++ b/include/llvm/Support/PatternMatch.h @@ -367,6 +367,17 @@ m_Select(const Cond &C, const LHS &L, const RHS &R) { return SelectClass_match<Cond, LHS, RHS>(C, L, R); } +/// m_SelectCst - This matches a select of two constants, e.g.: +/// m_SelectCst(m_Value(V), -1, 0) +template<typename Cond> +inline SelectClass_match<Cond, constantint_ty, constantint_ty> +m_SelectCst(const Cond &C, int64_t L, int64_t R) { + return SelectClass_match<Cond, constantint_ty, + constantint_ty>(C, m_ConstantInt(L), + m_ConstantInt(R)); +} + + //===----------------------------------------------------------------------===// // Matchers for CastInst classes // |