r298215 - Cleaning up the IdentifierResolver::iterator class a bit; NFC.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 19 08:15:28 PDT 2017


Author: aaronballman
Date: Sun Mar 19 10:15:28 2017
New Revision: 298215

URL: http://llvm.org/viewvc/llvm-project?rev=298215&view=rev
Log:
Cleaning up the IdentifierResolver::iterator class a bit; NFC.

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).

Modified:
    cfe/trunk/include/clang/Sema/IdentifierResolver.h

Modified: cfe/trunk/include/clang/Sema/IdentifierResolver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/IdentifierResolver.h?rev=298215&r1=298214&r2=298215&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/IdentifierResolver.h (original)
+++ cfe/trunk/include/clang/Sema/IdentifierResolver.h Sun Mar 19 10:15:28 2017
@@ -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'.




More information about the cfe-commits mailing list