]> granicus.if.org Git - clang/commitdiff
Check ConsiderGlobalVisibility before using -fvisibility.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 19 Apr 2012 04:37:16 +0000 (04:37 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 19 Apr 2012 04:37:16 +0000 (04:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155100 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Decl.cpp

index 7db38a9130099a235638f3e7189f6deb5f1b11d7..f26747bdf6f85bc98e3913892aaf2f2f01e2ae50 100644 (file)
@@ -291,7 +291,8 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) {
     }
   }
 
-  LV.mergeVisibility(Context.getLangOpts().getVisibilityMode());
+  if (F.ConsiderGlobalVisibility)
+    LV.mergeVisibility(Context.getLangOpts().getVisibilityMode());
 
   // C++ [basic.link]p4:
 
@@ -532,7 +533,8 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) {
   if (LV.linkage() == UniqueExternalLinkage)
     return LinkageInfo::uniqueExternal();
 
-  LV.mergeVisibility(D->getASTContext().getLangOpts().getVisibilityMode());
+  if (F.ConsiderGlobalVisibility)
+    LV.mergeVisibility(D->getASTContext().getLangOpts().getVisibilityMode());
 
   if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
     // If the type of the function uses a type with unique-external