From 1f2d22ab94db71b2f9070a54394956bf64ee83bb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 15 Jun 2006 19:25:28 +0000 Subject: Add some more matcher classes for shifts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28804 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/PatternMatch.h | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'include/llvm/Support/PatternMatch.h') diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h index d15ae9c498..7bf85e1a12 100644 --- a/include/llvm/Support/PatternMatch.h +++ b/include/llvm/Support/PatternMatch.h @@ -68,7 +68,7 @@ inline bind_ty m_Value(Value *&V) { return V; } inline bind_ty m_ConstantInt(ConstantInt *&CI) { return CI; } //===----------------------------------------------------------------------===// -// Matchers for specific binary operators +// Matchers for specific binary operators. // template +template struct BinaryOpClass_match { - Instruction::BinaryOps &Opcode; + OpcType &Opcode; LHS_t L; RHS_t R; - BinaryOpClass_match(Instruction::BinaryOps &Op, const LHS_t &LHS, + BinaryOpClass_match(OpcType &Op, const LHS_t &LHS, const RHS_t &RHS) : Opcode(Op), L(LHS), R(RHS) {} @@ -184,11 +184,26 @@ struct BinaryOpClass_match { }; template -inline BinaryOpClass_match +inline BinaryOpClass_match m_SetCond(Instruction::BinaryOps &Op, const LHS &L, const RHS &R) { - return BinaryOpClass_match(Op, L, R); + return BinaryOpClass_match(Op, L, R); } +template +inline BinaryOpClass_match +m_Shift(Instruction::OtherOps &Op, const LHS &L, const RHS &R) { + return BinaryOpClass_match(Op, L, R); +} + +template +inline BinaryOpClass_match +m_Shift(const LHS &L, const RHS &R) { + Instruction::OtherOps Op; + return BinaryOpClass_match(Op, L, R); +} //===----------------------------------------------------------------------===// // Matchers for unary operators -- cgit v1.2.3