From 0832963acdf1f6ded74830226c77d1ec6baebdd4 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 15 Jun 2010 17:05:35 +0000 Subject: Implement -fvisibility-inlines-hidden. llvm-svn: 106003 --- clang/lib/CodeGen/CodeGenModule.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 880d537..31842d6 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(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.1