]> granicus.if.org Git - clang/commitdiff
Remove calls to getMostRecentDecl. The case they were added for in r117526 are
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 12 Nov 2012 04:32:23 +0000 (04:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 12 Nov 2012 04:32:23 +0000 (04:32 +0000)
now covered by attribute merging.

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

lib/AST/Decl.cpp

index 7b13755979f13fb9c840ba98dfad919b69761271..74abbaa492de659efd50ba58700f76c74e88bc74 100644 (file)
@@ -656,8 +656,7 @@ LinkageInfo NamedDecl::getLinkageAndVisibility() const {
 llvm::Optional<Visibility> NamedDecl::getExplicitVisibility() const {
   // Use the most recent declaration of a variable.
   if (const VarDecl *Var = dyn_cast<VarDecl>(this)) {
-    if (llvm::Optional<Visibility> V =
-        getVisibilityOf(Var->getMostRecentDecl()))
+    if (llvm::Optional<Visibility> V = getVisibilityOf(Var))
       return V;
 
     if (Var->isStaticDataMember()) {
@@ -671,8 +670,7 @@ llvm::Optional<Visibility> NamedDecl::getExplicitVisibility() const {
   // Use the most recent declaration of a function, and also handle
   // function template specializations.
   if (const FunctionDecl *fn = dyn_cast<FunctionDecl>(this)) {
-    if (llvm::Optional<Visibility> V
-                            = getVisibilityOf(fn->getMostRecentDecl())) 
+    if (llvm::Optional<Visibility> V = getVisibilityOf(fn))
       return V;
 
     // If the function is a specialization of a template with an