[llvm-commits] CVS: llvm/include/llvm/Support/PatternMatch.h

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 3 21:46:10 PDT 2004



Changes in directory llvm/include/llvm/Support:

PatternMatch.h updated: 1.2 -> 1.3
---
Log message:

Minor efficiency improvements


---
Diffs of the changes:  (+3 -3)

Index: llvm/include/llvm/Support/PatternMatch.h
diff -u llvm/include/llvm/Support/PatternMatch.h:1.2 llvm/include/llvm/Support/PatternMatch.h:1.3
--- llvm/include/llvm/Support/PatternMatch.h:1.2	Fri Jul 30 09:33:07 2004
+++ llvm/include/llvm/Support/PatternMatch.h	Tue Aug  3 23:45:29 2004
@@ -36,8 +36,8 @@
 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 @@
 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) {






More information about the llvm-commits mailing list