1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

add a helper for matching "1".

llvm-svn: 83760
This commit is contained in:
Chris Lattner 2009-10-11 07:51:25 +00:00
parent 1832a32b78
commit 2a0366af9e

View File

@ -87,6 +87,18 @@ struct zero_ty {
/// m_Zero() - Match an arbitrary zero/null constant.
inline zero_ty m_Zero() { return zero_ty(); }
struct one_ty {
template<typename ITy>
bool match(ITy *V) {
if (const ConstantInt *C = dyn_cast<ConstantInt>(V))
return C->isOne();
return false;
}
};
/// m_One() - Match a an integer 1.
inline one_ty m_One() { return one_ty(); }
template<typename Class>
struct bind_ty {