diff options
| author | John McCall <rjmccall@apple.com> | 2010-11-01 01:29:57 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-11-01 01:29:57 +0000 |
| commit | e6e622e78937a9a344255ef33d9b7903ba462d2f (patch) | |
| tree | 9d6d421f570dbedd0b246fe42aeafd70753e2569 /clang/lib/AST/Decl.cpp | |
| parent | 25d9c7fa2e68fb7a0d119270067759bb7a1397b4 (diff) | |
| download | bcm5719-llvm-e6e622e78937a9a344255ef33d9b7903ba462d2f.tar.gz bcm5719-llvm-e6e622e78937a9a344255ef33d9b7903ba462d2f.zip | |
Only apply -fvisibility-inlines-hidden to definitions. Apparently
isInlined() just gives meaningless results for non-definitions.
Fixes rdar://problem/8614470
llvm-svn: 117887
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 7469e8b27fb..5eb9e8501ed 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -459,9 +459,15 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, // about whether containing classes have visibility attributes, // and that's intentional. if (TSK != TSK_ExplicitInstantiationDeclaration && - ConsiderGlobalVisibility && MD->isInlined() && - MD->getASTContext().getLangOptions().InlineVisibilityHidden) - LV.setVisibility(HiddenVisibility); + ConsiderGlobalVisibility && + MD->getASTContext().getLangOptions().InlineVisibilityHidden) { + // InlineVisibilityHidden only applies to definitions, and + // isInlined() only gives meaningful answers on definitions + // anyway. + const FunctionDecl *Def = 0; + if (MD->hasBody(Def) && Def->isInlined()) + LV.setVisibility(HiddenVisibility); + } // Note that in contrast to basically every other situation, we // *do* apply -fvisibility to method declarations. |

