Implement -fvisibility-inlines-hidden. <rdar://problem/7819834>

llvm-svn: 106003
This commit is contained in:
Douglas Gregor
2010-06-15 17:05:35 +00:00
parent 246e9a07a2
commit 0832963acd
8 changed files with 81 additions and 2 deletions

View File

@@ -152,6 +152,13 @@ CodeGenModule::getDeclVisibilityMode(const Decl *D) const {
}
}
// If -fvisibility-inlines-hidden was provided, then inline C++ member
// functions get "hidden" visibility by default.
if (getLangOptions().InlineVisibilityHidden)
if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(D))
if (Method->isInlined())
return LangOptions::Hidden;
// This decl should have the same visibility as its parent.
if (const DeclContext *DC = D->getDeclContext())
return getDeclVisibilityMode(cast<Decl>(DC));