From 7cf84d66965a7706004d8590b5af5fe54b85f525 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 15 Jun 2010 17:05:35 +0000 Subject: Implement -fvisibility-inlines-hidden. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106003 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/CodeGen/CodeGenModule.cpp') 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(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(DC)); -- cgit v1.2.3-18-g5258