]> granicus.if.org Git - clang/commitdiff
Now that the underlying problem has been fixed, add r168411 back.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 29 Nov 2012 16:38:22 +0000 (16:38 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 29 Nov 2012 16:38:22 +0000 (16:38 +0000)
Original commit message:

Remove redundant code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168900 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Decl.cpp

index ed48c439b549ef1c3f8d8e945e23c1d4475f24b4..1f390eec05eda345665621d5b00adfa19f0a323f 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;
     }