diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-04-19 04:37:16 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-04-19 04:37:16 +0000 |
commit | 4fc149057248a565ec9e539be66eeec42216282c (patch) | |
tree | dfd7d8c5c1a3201f17e9720b677537e9ce16cb04 /lib/AST/Decl.cpp | |
parent | 415745474c3057cb135a8a0fb2655901b90f3170 (diff) |
Check ConsiderGlobalVisibility before using -fvisibility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 7db38a9130..f26747bdf6 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -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 |