aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/PatternMatch.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Support/PatternMatch.h')
-rw-r--r--include/llvm/Support/PatternMatch.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h
index ea065a769e..cb94fe5f6e 100644
--- a/include/llvm/Support/PatternMatch.h
+++ b/include/llvm/Support/PatternMatch.h
@@ -75,6 +75,16 @@ inline constantint_ty<Val> m_ConstantInt() {
return constantint_ty<Val>();
}
+struct undef_ty {
+ template<typename ITy>
+ bool match(ITy *V) {
+ return isa<UndefValue>(V);
+ }
+};
+
+/// m_Undef() - Match an arbitrary undef constant.
+inline undef_ty m_Undef() { return undef_ty(); }
+
struct zero_ty {
template<typename ITy>
bool match(ITy *V) {