@@ -822,6 +822,8 @@ template <typename Class> struct bind_ty {
822822 }
823823};
824824
825+ // / Check whether the value has the given Class and matches the nested
826+ // / pattern. Capture it into the provided variable if successful.
825827template <typename Class, typename MatchTy> struct bind_and_match_ty {
826828 Class *&VR;
827829 MatchTy Match;
@@ -842,12 +844,14 @@ template <typename Class, typename MatchTy> struct bind_and_match_ty {
842844inline bind_ty<Value> m_Value (Value *&V) { return V; }
843845inline bind_ty<const Value> m_Value (const Value *&V) { return V; }
844846
847+ // / Match against the nested pattern, and capture the value if we match.
845848template <typename MatchTy>
846849inline bind_and_match_ty<Value, MatchTy> m_Value (Value *&V,
847850 const MatchTy &Match) {
848851 return {V, Match};
849852}
850853
854+ // / Match against the nested pattern, and capture the value if we match.
851855template <typename MatchTy>
852856inline bind_and_match_ty<const Value, MatchTy> m_Value (const Value *&V,
853857 const MatchTy &Match) {
@@ -857,6 +861,7 @@ inline bind_and_match_ty<const Value, MatchTy> m_Value(const Value *&V,
857861// / Match an instruction, capturing it if we match.
858862inline bind_ty<Instruction> m_Instruction (Instruction *&I) { return I; }
859863
864+ // / Match against the nested pattern, and capture the instruction if we match.
860865template <typename MatchTy>
861866inline bind_and_match_ty<Instruction, MatchTy>
862867m_Instruction (Instruction *&I, const MatchTy &Match) {
0 commit comments