diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-06-15 17:05:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-06-15 17:05:35 +0000 |
commit | 7cf84d66965a7706004d8590b5af5fe54b85f525 (patch) | |
tree | bcc7397a34cd1c069185c002879ee961a4af1f5f /lib/CodeGen/CodeGenModule.cpp | |
parent | 7fb2c25ab0b6fa1543bce410dbdb2ee5d2513a86 (diff) |
Implement -fvisibility-inlines-hidden. <rdar://problem/7819834>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 880d5372bf..31842d6144 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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)); |