summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-15 17:05:35 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-15 17:05:35 +0000
commit0832963acdf1f6ded74830226c77d1ec6baebdd4 (patch)
tree32ec95a92adce302f731636ba5186bc7a3c1aaf8 /clang/lib/CodeGen/CodeGenModule.cpp
parent246e9a07a245c2e11cfc67946667aea5d604d5ea (diff)
downloadbcm5719-llvm-0832963acdf1f6ded74830226c77d1ec6baebdd4.tar.gz
bcm5719-llvm-0832963acdf1f6ded74830226c77d1ec6baebdd4.zip
Implement -fvisibility-inlines-hidden. <rdar://problem/7819834>
llvm-svn: 106003
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 880d5372bf0..31842d61445 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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));
OpenPOWER on IntegriCloud