[llvm-branch-commits] [llvm-branch] r109175 - in /llvm/branches/ggreif/waymark-64: include/llvm/Use.h lib/VMCore/Use.cpp

Gabor Greif ggreif at gmail.com
Thu Jul 22 15:07:57 PDT 2010


Author: ggreif
Date: Thu Jul 22 17:07:57 2010
New Revision: 109175

URL: http://llvm.org/viewvc/llvm-project?rev=109175&view=rev
Log:
minor cleanups

Modified:
    llvm/branches/ggreif/waymark-64/include/llvm/Use.h
    llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp

Modified: llvm/branches/ggreif/waymark-64/include/llvm/Use.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/waymark-64/include/llvm/Use.h?rev=109175&r1=109174&r2=109175&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64/include/llvm/Use.h (original)
+++ llvm/branches/ggreif/waymark-64/include/llvm/Use.h Thu Jul 22 17:07:57 2010
@@ -115,9 +115,9 @@
   /// getPrefix - Return deletable pointer if appropriate
   Use *getPrefix();
 private:
-  enum { availableTagBits = sizeof(Use*) < 8 ? 2 : 3 };
+  enum { availableTagBits = PointerLikeTypeTraits<Use**>::NumLowBitsAvailable };
   template <unsigned>
-  struct Traits;
+  static const Use* getImpliedUser(const Use*);
   inline const Use* getImpliedUser() const;
   static Use *initTags(Use *Start, Use *Stop, ptrdiff_t Done = 0);
   
@@ -144,17 +144,11 @@
   friend class User;
 };
 
-  template <>
-  struct Use::Traits<2> {
-    static const Use* getImpliedUser(const Use*);
-  };
-  template <>
-  struct Use::Traits<3> {
-    static const Use* getImpliedUser(const Use*);
-  };
-  inline const Use* Use::getImpliedUser() const {
-		return Traits<availableTagBits>::getImpliedUser(this);
-	}
+template <> const Use* Use::getImpliedUser<2>(const Use*);
+template <> const Use* Use::getImpliedUser<3>(const Use*);
+inline const Use* Use::getImpliedUser() const {
+  return getImpliedUser<availableTagBits>(this);
+}
 
 // simplify_type - Allow clients to treat uses just like values when using
 // casting operators.

Modified: llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp?rev=109175&r1=109174&r2=109175&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp (original)
+++ llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp Thu Jul 22 17:07:57 2010
@@ -48,11 +48,13 @@
 //                         Use getImpliedUser Implementations
 //===----------------------------------------------------------------------===//
 
-const Use *Use::Traits<3>::getImpliedUser(const Use *Current) {
-  return Traits<2>::getImpliedUser(Current);
+template <>
+const Use *Use::getImpliedUser<3>(const Use *Current) {
+  return getImpliedUser<2>(Current);
 }
 
-const Use *Use::Traits<2>::getImpliedUser(const Use *Current) {
+template <>
+const Use *Use::getImpliedUser<2>(const Use *Current) {
   while (true) {
     unsigned Tag = (Current++)->Prev.getInt();
     switch (Tag) {





More information about the llvm-branch-commits mailing list