aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/PatternMatch.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/PatternMatch.h b/include/llvm/Support/PatternMatch.h
index 04ebe2c907..5a1df2a7a3 100644
--- a/include/llvm/Support/PatternMatch.h
+++ b/include/llvm/Support/PatternMatch.h
@@ -36,8 +36,8 @@ namespace llvm {
namespace PatternMatch {
template<typename Val, typename Pattern>
-bool match(Val *V, Pattern P) {
- return P.match(V);
+bool match(Val *V, const Pattern &P) {
+ return const_cast<Pattern&>(P).match(V);
}
template<typename Class>
@@ -52,7 +52,7 @@ inline leaf_ty<ConstantInt> m_ConstantInt() { return leaf_ty<ConstantInt>(); }
template<typename Class>
struct bind_ty {
Class *&VR;
- bind_ty(Class*& V) :VR(V) {}
+ bind_ty(Class *&V) : VR(V) {}
template<typename ITy>
bool match(ITy *V) {