From 6ab187a49a42de6d351248d8a6e0206e39743a0c Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 7 Apr 2009 05:48:37 +0000 Subject: Various fixes to symbols used for Obj-C x86_64 metadata. - Changed method names to match gcc (categories names still aren't mangled in). - Expose correct name for class and metadata symbols (although -fvisibility=hidden isn't yet correct). - Remove several things from llvm.used that didn't need to be there (I suspect this can still be trimmed). - Don't use asm-prefix extension for _objc_empty_{cache,vtable} (not needed). - Hide EH type class info with -fvisibility=hidden - Change setGlobal[Option]Visibility to not change the visibility of functions with internal linkage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68510 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 379ff9b424..1dd2c4d67f 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -99,6 +99,10 @@ void CodeGenModule::ErrorUnsupported(const Decl *D, const char *Type, /// GlobalValue according to the given clang AST visibility value. static void setGlobalVisibility(llvm::GlobalValue *GV, VisibilityAttr::VisibilityTypes Vis) { + // Do not change the visibility of internal definitions. + if (GV->hasInternalLinkage()) + return; + switch (Vis) { default: assert(0 && "Unknown visibility!"); case VisibilityAttr::DefaultVisibility: @@ -115,6 +119,10 @@ static void setGlobalVisibility(llvm::GlobalValue *GV, static void setGlobalOptionVisibility(llvm::GlobalValue *GV, LangOptions::VisibilityMode Vis) { + // Do not change the visibility of internal definitions. + if (GV->hasInternalLinkage()) + return; + switch (Vis) { default: assert(0 && "Unknown visibility!"); case LangOptions::NonVisibility: -- cgit v1.2.3-18-g5258