From 3d3d339357651dfdc1ca12ff91ec12369ba388e0 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 19 Apr 2012 04:27:47 +0000 Subject: [PATCH] The explicit bit in LV already tracks exactly the same information as DHasExplicitVisibility. Simplify the code a bit. llvm-svn: 155099 --- clang/lib/AST/Decl.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 12f8f7e0b17c..7db38a913009 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -484,18 +484,14 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) { LinkageInfo LV; - bool DHasExplicitVisibility = false; // If we have an explicit visibility attribute, merge that in. if (F.ConsiderVisibilityAttributes) { - if (llvm::Optional Vis = D->getExplicitVisibility()) { + if (llvm::Optional Vis = D->getExplicitVisibility()) LV.mergeVisibility(*Vis, true); - - DHasExplicitVisibility = true; - } } // Ignore both global visibility and attributes when computing our // parent's visibility if we already have an explicit one. - LVFlags ClassF = DHasExplicitVisibility ? + LVFlags ClassF = LV.visibilityExplicit() ? LVFlags::CreateOnlyDeclLinkage() : F; // If we're paying attention to global visibility, apply