add a new template for matching a select between two constants.

llvm-svn: 59391
This commit is contained in:
Chris Lattner 2008-11-16 04:33:10 +00:00
parent cba75c1b7b
commit f612178d64

View File

@ -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
//