From 074c1919167a272860a65f861c81d7d3ff37cd72 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 18 Apr 2012 00:14:58 +0000 Subject: [PATCH] Calling setVisibility directly only makes (some) sense when the visibility is explicit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154969 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Decl.h | 1 - lib/AST/Decl.cpp | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 708d6c6c98..ac7ab0f9d1 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -245,7 +245,6 @@ public: bool visibilityExplicit() const { return explicit_; } void setLinkage(Linkage L) { linkage_ = L; } - void setVisibility(Visibility V) { visibility_ = V; } void setVisibility(Visibility V, bool E) { visibility_ = V; explicit_ = E; } void mergeLinkage(Linkage L) { diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 07098fdb3a..53032bc64d 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -785,7 +785,7 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, LVFlags Flags) { LinkageInfo LV; if (Flags.ConsiderVisibilityAttributes) { if (llvm::Optional Vis = Function->getExplicitVisibility()) - LV.setVisibility(*Vis); + LV.setVisibility(*Vis, true); } if (const FunctionDecl *Prev = Function->getPreviousDecl()) { @@ -806,10 +806,10 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, LVFlags Flags) { LinkageInfo LV; if (Var->getStorageClass() == SC_PrivateExtern) - LV.setVisibility(HiddenVisibility); + LV.setVisibility(HiddenVisibility, true); else if (Flags.ConsiderVisibilityAttributes) { if (llvm::Optional Vis = Var->getExplicitVisibility()) - LV.setVisibility(*Vis); + LV.setVisibility(*Vis, true); } if (const VarDecl *Prev = Var->getPreviousDecl()) { -- 2.40.0