[llvm-branch-commits] [llvm-branch] r202044 - tweaks to compile for non-3bit too

Gabor Greif ggreif at gmail.com
Mon Feb 24 07:18:01 PST 2014


Author: ggreif
Date: Mon Feb 24 09:18:01 2014
New Revision: 202044

URL: http://llvm.org/viewvc/llvm-project?rev=202044&view=rev
Log:
tweaks to compile for non-3bit too

Modified:
    llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp

Modified: llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp?rev=202044&r1=202043&r2=202044&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp (original)
+++ llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp Mon Feb 24 09:18:01 2014
@@ -76,10 +76,8 @@ const Use *Use::getImpliedUser<false>()
         }
       }
 
-      case T::fullStopTag:
+      default: // can only be T::fullStopTag
         return Current;
-
-      default:; // absorb Tag3 values to suppress warnings
     }
   }
 }
@@ -87,22 +85,23 @@ const Use *Use::getImpliedUser<false>()
 
 template<>
 const Use *Use::getImpliedUser<true>() const {
+  typedef PrevPointerIntPair<true> T;
   const Use *Current = this;
 
   while (true) {
     switch (unsigned Tag = Current->Prev.getInt()) {
-      case fullStopTag3: return Current + 1;
-      case stopTag3:
-      case skipStopTag3:
-      case skip2StopTag3: {
+      case T::fullStopTag3: return Current + 1;
+      case T::stopTag3:
+      case T::skipStopTag3:
+      case T::skip2StopTag3: {
         Current += Tag;
         ptrdiff_t Offset = 0;
         while (true) {
           switch (unsigned Tag = Current->Prev.getInt()) {
-            case zeroZeroDigitTag3:
-            case zeroOneDigitTag3:
-            case oneZeroDigitTag3:
-            case oneOneDigitTag3:
+            case T::zeroZeroDigitTag3:
+            case T::zeroOneDigitTag3:
+            case T::oneZeroDigitTag3:
+            case T::oneOneDigitTag3:
               ++Current;
               Offset = (Offset << 2) | (Tag & 0x3);
               continue;
@@ -165,11 +164,12 @@ Use *Use::initTags<false>(Use * const St
 
 template<>
 Use *Use::initTags<true>(Use * const Start, Use *Stop) {
+  typedef PrevPointerIntPair<true> T;
   ptrdiff_t Done = 0;
   while (Done < 17) {
     if (Start == Stop--)
       return Start;
-#   define TAG_AT(N, TAG) (uintptr_t(TAG ## Tag3) << ((N) * 3))
+#   define TAG_AT(N, TAG) (uintptr_t(T::TAG ## Tag3) << ((N) * 3))
     static const uintptr_t tags =
       TAG_AT(0, fullStop) | TAG_AT(1, stop) | TAG_AT(2, skipStop) |
       TAG_AT(3, oneOneDigit) | TAG_AT(4, stop) | TAG_AT(5, skipStop) |
@@ -184,18 +184,18 @@ Use *Use::initTags<true>(Use * const Sta
   ptrdiff_t Count = Done;
   while (Start != Stop--) {
     if (!Count) {
-      new(Stop) Use(stopTag3);
+      new(Stop) Use(T::stopTag3);
       ++Done;
       if (Start == Stop--) return Start;
-      new(Stop) Use(skipStopTag3);
+      new(Stop) Use(T::skipStopTag3);
       ++Done;
       if (Start == Stop--) return Start;
-      new(Stop) Use(skip2StopTag3);
+      new(Stop) Use(T::skip2StopTag3);
       ++Done;
       if (Start == Stop) return Start;
       Count = Done;
     } else {
-      new(Stop) Use(Tag_t(zeroZeroDigitTag3 | (Count & 0x3)));
+      new(Stop) Use(Tag_t(T::zeroZeroDigitTag3 | (Count & 0x3)));
       Count >>= 2;
       ++Done;
     }
@@ -204,7 +204,6 @@ Use *Use::initTags<true>(Use * const Sta
   return Start;
 }
 
-
 //===----------------------------------------------------------------------===//
 //                         Use zap Implementation
 //===----------------------------------------------------------------------===//





More information about the llvm-branch-commits mailing list