summaryrefslogtreecommitdiffstats
path: root/llvm/include/llvm/IR/PatternMatch.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/IR/PatternMatch.h')
-rw-r--r--llvm/include/llvm/IR/PatternMatch.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h
index 0f03d7cc56b..b6b2fa88f5b 100644
--- a/llvm/include/llvm/IR/PatternMatch.h
+++ b/llvm/include/llvm/IR/PatternMatch.h
@@ -300,6 +300,15 @@ template <typename Predicate> struct cstfp_pred_ty : public Predicate {
//
///////////////////////////////////////////////////////////////////////////////
+struct is_any_apint {
+ bool isValue(const APInt &C) { return true; }
+};
+/// Match an integer or vector with any integral constant.
+/// For vectors, this includes constants with undefined elements.
+inline cst_pred_ty<is_any_apint> m_AnyIntegralConstant() {
+ return cst_pred_ty<is_any_apint>();
+}
+
struct is_all_ones {
bool isValue(const APInt &C) { return C.isAllOnesValue(); }
};
OpenPOWER on IntegriCloud