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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59393 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-11-16 04:38:30 +00:00
parent 321e6a6e82
commit a236c89ee3

View File

@ -100,6 +100,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.