[cfe-commits] r168411 - /cfe/trunk/lib/AST/Decl.cpp

Rafael Espindola rafael.espindola at gmail.com
Tue Nov 20 18:53:23 PST 2012


Author: rafael
Date: Tue Nov 20 20:53:22 2012
New Revision: 168411

URL: http://llvm.org/viewvc/llvm-project?rev=168411&view=rev
Log:
Remove redundant code.

Modified:
    cfe/trunk/lib/AST/Decl.cpp

Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=168411&r1=168410&r2=168411&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Nov 20 20:53:22 2012
@@ -777,12 +777,10 @@
         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;
     }





More information about the cfe-commits mailing list