From c894b326cf10b1ea4610ccddcc40e5648363c9ba Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 19 Jun 2013 02:07:51 +0000 Subject: [PATCH] Delete dead code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184277 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Sema/IdentifierResolver.h | 10 ------- lib/Sema/IdentifierResolver.cpp | 37 ------------------------- 2 files changed, 47 deletions(-) diff --git a/include/clang/Sema/IdentifierResolver.h b/include/clang/Sema/IdentifierResolver.h index 0b1b74a0d8..99d94a1fed 100644 --- a/include/clang/Sema/IdentifierResolver.h +++ b/include/clang/Sema/IdentifierResolver.h @@ -51,11 +51,6 @@ class IdentifierResolver { /// The decl must already be part of the decl chain. void RemoveDecl(NamedDecl *D); - /// Replaces the Old declaration with the New declaration. If the - /// replacement is successful, returns true. If the old - /// declaration was not found, returns false. - bool ReplaceDecl(NamedDecl *Old, NamedDecl *New); - /// \brief Insert the given declaration at the given position in the list. void InsertDecl(DeclsTy::iterator Pos, NamedDecl *D) { Decls.insert(Pos, D); @@ -168,11 +163,6 @@ public: /// The decl must already be part of the decl chain. void RemoveDecl(NamedDecl *D); - /// Replace the decl Old with the new declaration New on its - /// identifier chain. Returns true if the old declaration was found - /// (and, therefore, replaced). - bool ReplaceDecl(NamedDecl *Old, NamedDecl *New); - /// \brief Insert the given declaration after the given iterator /// position. void InsertDeclAfter(iterator Pos, NamedDecl *D); diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp index d44c1fb926..7f5d972f07 100644 --- a/lib/Sema/IdentifierResolver.cpp +++ b/lib/Sema/IdentifierResolver.cpp @@ -78,19 +78,6 @@ void IdentifierResolver::IdDeclInfo::RemoveDecl(NamedDecl *D) { llvm_unreachable("Didn't find this decl on its identifier's chain!"); } -bool -IdentifierResolver::IdDeclInfo::ReplaceDecl(NamedDecl *Old, NamedDecl *New) { - for (DeclsTy::iterator I = Decls.end(); I != Decls.begin(); --I) { - if (Old == *(I-1)) { - *(I - 1) = New; - return true; - } - } - - return false; -} - - //===----------------------------------------------------------------------===// // IdentifierResolver Implementation //===----------------------------------------------------------------------===// @@ -235,30 +222,6 @@ void IdentifierResolver::RemoveDecl(NamedDecl *D) { return toIdDeclInfo(Ptr)->RemoveDecl(D); } -bool IdentifierResolver::ReplaceDecl(NamedDecl *Old, NamedDecl *New) { - assert(Old->getDeclName() == New->getDeclName() && - "Cannot replace a decl with another decl of a different name"); - - DeclarationName Name = Old->getDeclName(); - if (IdentifierInfo *II = Name.getAsIdentifierInfo()) - updatingIdentifier(*II); - - void *Ptr = Name.getFETokenInfo(); - - if (!Ptr) - return false; - - if (isDeclPtr(Ptr)) { - if (Ptr == Old) { - Name.setFETokenInfo(New); - return true; - } - return false; - } - - return toIdDeclInfo(Ptr)->ReplaceDecl(Old, New); -} - /// begin - Returns an iterator for decls with name 'Name'. IdentifierResolver::iterator IdentifierResolver::begin(DeclarationName Name) { -- 2.40.0