From bf516f7a5d3385ab9989220eface8d5709038924 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 27 Jun 2013 21:04:24 +0000 Subject: [PATCH] Delete dead code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185103 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Decl.h | 4 ---- include/clang/AST/DeclBase.h | 1 - lib/AST/Decl.cpp | 12 ------------ lib/AST/DeclBase.cpp | 26 -------------------------- 4 files changed, 43 deletions(-) diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 25e37099f8..2eaf8d3a7f 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -931,10 +931,6 @@ public: return const_cast(this)->getActingDefinition(); } - /// \brief Determine whether this is a tentative definition of a - /// variable in C. - bool isTentativeDefinitionNow() const; - /// \brief Get the real (not just tentative) definition for this declaration. VarDecl *getDefinition(ASTContext &); const VarDecl *getDefinition(ASTContext &C) const { diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index b5cbf9b814..4f289d315a 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -428,7 +428,6 @@ public: return const_cast(const_cast(this)->getAttrs()); } const AttrVec &getAttrs() const; - void swapAttrs(Decl *D); void dropAttrs(); void addAttr(Attr *A) { diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index f934c76a41..adba897bb5 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1715,18 +1715,6 @@ VarDecl *VarDecl::getActingDefinition() { return LastTentative; } -bool VarDecl::isTentativeDefinitionNow() const { - DefinitionKind Kind = isThisDeclarationADefinition(); - if (Kind != TentativeDefinition) - return false; - - for (redecl_iterator I = redecls_begin(), E = redecls_end(); I != E; ++I) { - if ((*I)->isThisDeclarationADefinition() == Definition) - return false; - } - return true; -} - VarDecl *VarDecl::getDefinition(ASTContext &C) { VarDecl *First = getFirstDeclaration(); for (redecl_iterator I = First->redecls_begin(), E = First->redecls_end(); diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 815f9ed90c..7caf698c98 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -595,32 +595,6 @@ const AttrVec &Decl::getAttrs() const { return getASTContext().getDeclAttrs(this); } -void Decl::swapAttrs(Decl *RHS) { - bool HasLHSAttr = this->HasAttrs; - bool HasRHSAttr = RHS->HasAttrs; - - // Usually, neither decl has attrs, nothing to do. - if (!HasLHSAttr && !HasRHSAttr) return; - - // If 'this' has no attrs, swap the other way. - if (!HasLHSAttr) - return RHS->swapAttrs(this); - - ASTContext &Context = getASTContext(); - - // Handle the case when both decls have attrs. - if (HasRHSAttr) { - std::swap(Context.getDeclAttrs(this), Context.getDeclAttrs(RHS)); - return; - } - - // Otherwise, LHS has an attr and RHS doesn't. - Context.getDeclAttrs(RHS) = Context.getDeclAttrs(this); - Context.eraseDeclAttrs(this); - this->HasAttrs = false; - RHS->HasAttrs = true; -} - Decl *Decl::castFromDeclContext (const DeclContext *D) { Decl::Kind DK = D->getDeclKind(); switch(DK) { -- 2.40.0