From: Aaron Ballman Date: Sun, 19 Mar 2017 15:15:28 +0000 (+0000) Subject: Cleaning up the IdentifierResolver::iterator class a bit; NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f304e39bb9d423169133175d08ec491ff7003e01;p=clang 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298215 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Sema/IdentifierResolver.h b/include/clang/Sema/IdentifierResolver.h index a07834f956..382fe80bea 100644 --- a/include/clang/Sema/IdentifierResolver.h +++ b/include/clang/Sema/IdentifierResolver.h @@ -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(Ptr & ~0x3); + return reinterpret_cast(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'.