summaryrefslogtreecommitdiff
path: root/include/llvm/Support/PatternMatch.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-08-04 04:45:29 +0000
committerChris Lattner <sabre@nondot.org>2004-08-04 04:45:29 +0000
commit7c136c3f8b7af841794f30eaaa4822b65f1eb4f7 (patch)
tree93419d25e47227851c61a22e344d8616da783436 /include/llvm/Support/PatternMatch.h
parent46c2b3a5eca387bdfcbc3213584ab88aff1e974d (diff)
downloadllvm-7c136c3f8b7af841794f30eaaa4822b65f1eb4f7.tar.gz
llvm-7c136c3f8b7af841794f30eaaa4822b65f1eb4f7.tar.bz2
llvm-7c136c3f8b7af841794f30eaaa4822b65f1eb4f7.tar.xz
Minor efficiency improvements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15461 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/PatternMatch.h')
-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) {