From 6dcddfb85237ffe1a214eef8162f9928e16de5d0 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 21 Nov 2012 02:53:22 +0000 Subject: [PATCH] Remove redundant code. llvm-svn: 168411 --- clang/lib/AST/Decl.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index ed48c43..1f390ee 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -777,12 +777,10 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, bool OnlyTemplate) { if (llvm::Optional Vis = Function->getExplicitVisibility()) LV.mergeVisibility(*Vis, true); } - - if (const FunctionDecl *Prev = Function->getPreviousDecl()) { - LinkageInfo PrevLV = getLVForDecl(Prev, OnlyTemplate); - if (PrevLV.linkage()) LV.setLinkage(PrevLV.linkage()); - LV.mergeVisibility(PrevLV); - } + + // Note that Sema::MergeCompatibleFunctionDecls already takes care of + // merging storage classes and visibility attributes, so we don't have to + // look at previous decls in here. return LV; } -- 2.7.4