2014-03-04 05:53:57 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -x objective-c %s -o - | FileCheck %s
|
|
|
|
// rdar://16203115
|
|
|
|
|
|
|
|
@interface NSObject @end
|
|
|
|
|
|
|
|
@protocol P0;
|
|
|
|
|
|
|
|
@interface A : NSObject <P0>
|
|
|
|
+(Class) getClass;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation A
|
|
|
|
+(Class) getClass { return self; }
|
|
|
|
@end
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
Protocol *P0 = @protocol(P0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Use private linkage for remaining GlobalVariables with private names.
This patch changes the remaining GlobalVariables using "\01L" and
"\01l" prefixes to use private linkage. What is strange about them is
that they currently use WeakAnyLinkage. There is no comment stating
why and that is really odd since the symbols are completely hidden, so
it doesn't make sense for them to be weak.
Clang revisions like r63329, r63408, r63770, r65761 set the linkage to
weak, but don't say why. I suspect they were just copying llvm-gcc.
In llvm-gcc I found r58599 and r56322 that set DECL_WEAK, but they
were just syncing from the apple gcc. I am not exactly sure what that
means, since the last commit to
svn://gcc.gnu.org/svn/gcc/branches/apple was in 2006, 2 years earlier.
In summary, I have no idea why weak linkage was being used :-(
To quote John McCall, "Let’s try without it and see" :-)
llvm-svn: 203059
2014-03-06 09:57:34 +08:00
|
|
|
// CHECK: @"\01l_OBJC_PROTOCOL_$_P0" = private global
|
2014-03-04 05:53:57 +08:00
|
|
|
// CHECK: @"\01l_OBJC_CLASS_PROTOCOLS_$_A" = private global
|
Use private linkage for remaining GlobalVariables with private names.
This patch changes the remaining GlobalVariables using "\01L" and
"\01l" prefixes to use private linkage. What is strange about them is
that they currently use WeakAnyLinkage. There is no comment stating
why and that is really odd since the symbols are completely hidden, so
it doesn't make sense for them to be weak.
Clang revisions like r63329, r63408, r63770, r65761 set the linkage to
weak, but don't say why. I suspect they were just copying llvm-gcc.
In llvm-gcc I found r58599 and r56322 that set DECL_WEAK, but they
were just syncing from the apple gcc. I am not exactly sure what that
means, since the last commit to
svn://gcc.gnu.org/svn/gcc/branches/apple was in 2006, 2 years earlier.
In summary, I have no idea why weak linkage was being used :-(
To quote John McCall, "Let’s try without it and see" :-)
llvm-svn: 203059
2014-03-06 09:57:34 +08:00
|
|
|
// CHECK: @"\01l_OBJC_LABEL_PROTOCOL_$_P0" = private global
|
|
|
|
// CHECK: @"\01l_OBJC_PROTOCOL_REFERENCE_$_P0" = private global
|