]> granicus.if.org Git - clang/commitdiff
Cleaning up the IdentifierResolver::iterator class a bit; NFC.
authorAaron Ballman <aaron@aaronballman.com>
Sun, 19 Mar 2017 15:15:28 +0000 (15:15 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Sun, 19 Mar 2017 15:15:28 +0000 (15:15 +0000)
The comment about there being three different forms that Ptr represents was stale. Also, the opaque value does not need to be exposed (these functions are unused).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298215 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/IdentifierResolver.h

index a07834f95629e50160513fbcfc3a677791dd4ee1..382fe80bea7dab451cbb1b2a1fe391b14f3a7fab 100644 (file)
@@ -73,12 +73,10 @@ public:
     typedef std::input_iterator_tag iterator_category;
     typedef std::ptrdiff_t          difference_type;
 
-    /// Ptr - There are 3 forms that 'Ptr' represents:
+    /// Ptr - There are 2 forms that 'Ptr' represents:
     /// 1) A single NamedDecl. (Ptr & 0x1 == 0)
     /// 2) A IdDeclInfo::DeclsTy::iterator that traverses only the decls of the
-    ///    same declaration context. (Ptr & 0x3 == 0x1)
-    /// 3) A IdDeclInfo::DeclsTy::iterator that traverses the decls of parent
-    ///    declaration contexts too. (Ptr & 0x3 == 0x3)
+    ///    same declaration context. (Ptr & 0x1 == 0x1)
     uintptr_t Ptr;
     typedef IdDeclInfo::DeclsTy::iterator BaseIter;
 
@@ -97,7 +95,7 @@ public:
 
     BaseIter getIterator() const {
       assert(isIterator() && "Ptr not an iterator!");
-      return reinterpret_cast<BaseIter>(Ptr & ~0x3);
+      return reinterpret_cast<BaseIter>(Ptr & ~0x1);
     }
 
     friend class IdentifierResolver;
@@ -128,14 +126,6 @@ public:
         incrementSlowCase();
       return *this;
     }
-
-    uintptr_t getAsOpaqueValue() const { return Ptr; }
-
-    static iterator getFromOpaqueValue(uintptr_t P) {
-      iterator Result;
-      Result.Ptr = P;
-      return Result;
-    }
   };
 
   /// begin - Returns an iterator for decls with the name 'Name'.