Remove redundant code.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 21 Nov 2012 02:53:22 +0000 (02:53 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 21 Nov 2012 02:53:22 +0000 (02:53 +0000)
llvm-svn: 168411

clang/lib/AST/Decl.cpp

index ed48c43..1f390ee 100644 (file)
@@ -777,12 +777,10 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, bool OnlyTemplate) {
         if (llvm::Optional<Visibility> 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;
     }