diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h index 04ebe2c9076..5a1df2a7a32 100644 --- a/include/llvm/Support/PatternMatch.h +++ b/include/llvm/Support/PatternMatch.h @@ -36,8 +36,8 @@ namespace llvm { namespace PatternMatch { template -bool match(Val *V, Pattern P) { - return P.match(V); +bool match(Val *V, const Pattern &P) { + return const_cast(P).match(V); } template @@ -52,7 +52,7 @@ inline leaf_ty m_ConstantInt() { return leaf_ty(); } template struct bind_ty { Class *&VR; - bind_ty(Class*& V) :VR(V) {} + bind_ty(Class *&V) : VR(V) {} template bool match(ITy *V) {