[cfe-commits] r154969 - in /cfe/trunk: include/clang/AST/Decl.h lib/AST/Decl.cpp
Rafael Espindola
rafael.espindola at gmail.com
Tue Apr 17 17:14:58 PDT 2012
Author: rafael
Date: Tue Apr 17 19:14:58 2012
New Revision: 154969
URL: http://llvm.org/viewvc/llvm-project?rev=154969&view=rev
Log:
Calling setVisibility directly only makes (some) sense when the visibility is
explicit.
Modified:
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/lib/AST/Decl.cpp
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=154969&r1=154968&r2=154969&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Tue Apr 17 19:14:58 2012
@@ -245,7 +245,6 @@
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) {
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=154969&r1=154968&r2=154969&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Apr 17 19:14:58 2012
@@ -785,7 +785,7 @@
LinkageInfo LV;
if (Flags.ConsiderVisibilityAttributes) {
if (llvm::Optional<Visibility> Vis = Function->getExplicitVisibility())
- LV.setVisibility(*Vis);
+ LV.setVisibility(*Vis, true);
}
if (const FunctionDecl *Prev = Function->getPreviousDecl()) {
@@ -806,10 +806,10 @@
LinkageInfo LV;
if (Var->getStorageClass() == SC_PrivateExtern)
- LV.setVisibility(HiddenVisibility);
+ LV.setVisibility(HiddenVisibility, true);
else if (Flags.ConsiderVisibilityAttributes) {
if (llvm::Optional<Visibility> Vis = Var->getExplicitVisibility())
- LV.setVisibility(*Vis);
+ LV.setVisibility(*Vis, true);
}
if (const VarDecl *Prev = Var->getPreviousDecl()) {
More information about the cfe-commits
mailing list