r175479 - Use the actual class visibility for the ObjC EHTYPE global,

John McCall rjmccall at apple.com
Mon Feb 18 17:57:29 PST 2013


Author: rjmccall
Date: Mon Feb 18 19:57:29 2013
New Revision: 175479

URL: http://llvm.org/viewvc/llvm-project?rev=175479&view=rev
Log:
Use the actual class visibility for the ObjC EHTYPE global,
not the global visibility mode.

Noticed by inspection.

Added:
    cfe/trunk/test/CodeGenObjC/attr-exception.m
Modified:
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=175479&r1=175478&r2=175479&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Mon Feb 18 19:57:29 2013
@@ -7054,7 +7054,7 @@ CGObjCNonFragileABIMac::GetInterfaceEHTy
                                       ID->getIdentifier()->getName()));
   }
 
-  if (CGM.getLangOpts().getVisibilityMode() == HiddenVisibility)
+  if (ID->getVisibility() == HiddenVisibility)
     Entry->setVisibility(llvm::GlobalValue::HiddenVisibility);
   Entry->setAlignment(CGM.getDataLayout().getABITypeAlignment(
       ObjCTypes.EHTypeTy));

Added: cfe/trunk/test/CodeGenObjC/attr-exception.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/attr-exception.m?rev=175479&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/attr-exception.m (added)
+++ cfe/trunk/test/CodeGenObjC/attr-exception.m Mon Feb 18 19:57:29 2013
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -fobjc-exceptions -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fexceptions -fobjc-exceptions -fvisibility hidden -o - %s | FileCheck -check-prefix=CHECK-HIDDEN %s
+
+__attribute__((objc_root_class)) 
+ at interface Root {
+  Class isa;
+}
+ at end
+
+__attribute__((objc_exception))
+ at interface A : Root
+ at end
+
+ at implementation A
+ at end
+// CHECK: @"OBJC_EHTYPE_$_A" = global {{%.*}} { i8** getelementptr (i8** @objc_ehtype_vtable, i32 2)
+// CHECK-HIDDEN: @"OBJC_EHTYPE_$_A" = hidden global {{%.*}} { i8** getelementptr (i8** @objc_ehtype_vtable, i32 2)
+
+__attribute__((objc_exception))
+__attribute__((visibility("default")))
+ at interface B : Root
+ at end
+
+ at implementation B
+ at end
+// CHECK: @"OBJC_EHTYPE_$_B" = global {{%.*}} { i8** getelementptr (i8** @objc_ehtype_vtable, i32 2)
+// CHECK-HIDDEN: @"OBJC_EHTYPE_$_B" = global {{%.*}} { i8** getelementptr (i8** @objc_ehtype_vtable, i32 2)





More information about the cfe-commits mailing list