add a new m_Specific pattern that matches only if we have a specific Value*.

llvm-svn: 59393
This commit is contained in:
Chris Lattner 2008-11-16 04:38:30 +00:00
parent fae5e33111
commit 50b9a15a43
1 changed files with 15 additions and 0 deletions

View File

@ -101,6 +101,21 @@ inline bind_ty<Value> m_Value(Value *&V) { return V; }
/// m_ConstantInt - Match a ConstantInt, capturing the value if we match.
inline bind_ty<ConstantInt> m_ConstantInt(ConstantInt *&CI) { return CI; }
/// specificval_ty - Match a specified Value*.
struct specificval_ty {
const Value *Val;
specificval_ty(const Value *V) : Val(V) {}
template<typename ITy>
bool match(ITy *V) {
return V == Val;
}
};
/// m_Specific - Match if we have a specific specified value.
inline specificval_ty m_Specific(const Value *V) { return V; }
//===----------------------------------------------------------------------===//
// Matchers for specific binary operators.
//