get the first few tags from a precomputed table (count can be increased if desired)
authorGabor Greif <ggreif@gmail.com>
Fri, 16 Jul 2010 20:35:19 +0000 (20:35 +0000)
committerGabor Greif <ggreif@gmail.com>
Fri, 16 Jul 2010 20:35:19 +0000 (20:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108549 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Use.cpp

index b7fd92f9b06603e93f438444c62b8e3aecfab930..af38a2d6b3fa90114306e4453afc3ab7bd30cef2 100644 (file)
@@ -86,6 +86,15 @@ const Use *Use::getImpliedUser() const {
 //===----------------------------------------------------------------------===//
 
 Use *Use::initTags(Use * const Start, Use *Stop, ptrdiff_t Done) {
+  while (Done < 6) {
+    if (Start == Stop--)
+      return Start;
+    static const PrevPtrTag tags[6] = { fullStopTag, oneDigitTag, stopTag,
+                                        oneDigitTag, oneDigitTag, stopTag };
+    Stop->Prev.setFromOpaqueValue(reinterpret_cast<Use**>(tags[Done++]));
+    Stop->Val = 0;
+  }
+
   ptrdiff_t Count = Done;
   while (Start != Stop) {
     --Stop;