llvm.org GIT mirror llvm / 1f21e0d
Remove the linker_private and linker_private_weak linkages. These linkages were introduced some time ago, but it was never very clear what exactly their semantics were or what they should be used for. Some investigation found these uses: * utf-16 strings in clang. * non-unnamed_addr strings produced by the sanitizers. It turns out they were just working around a more fundamental problem. For some sections a MachO linker needs a symbol in order to split the section into atoms, and llvm had no idea that was the case. I fixed that in r201700 and it is now safe to use the private linkage. When the object ends up in a section that requires symbols, llvm will use a 'l' prefix instead of a 'L' prefix and things just work. With that, these linkages were already dead, but there was a potential future user in the objc metadata information. I am still looking at CGObjcMac.cpp, but at this point I am convinced that linker_private and linker_private_weak are not what they need. The objc uses are currently split in * Regular symbols (no '\01' prefix). LLVM already directly provides whatever semantics they need. * Uses of a private name (start with "\01L" or "\01l") and private linkage. We can drop the "\01L" and "\01l" prefixes as soon as llvm agrees with clang on L being ok or not for a given section. I have two patches in code review for this. * Uses of private name and weak linkage. The last case is the one that one could think would fit one of these linkages. That is not the case. The semantics are * the linker will merge these symbol by *name*. * the linker will hide them in the final DSO. Given that the merging is done by name, any of the private (or internal) linkages would be a bad match. They allow llvm to rename the symbols, and that is really not what we want. From the llvm point of view, these objects should really be (linkonce|weak)(_odr)?. For now, just keeping the "\01l" prefix is probably the best for these symbols. If we one day want to have a more direct support in llvm, IMHO what we should add is not a linkage, it is just a hidden_symbol attribute. It would be applicable to multiple linkages. For example, on weak it would produce the current behavior we have for objc metadata. On internal, it would be equivalent to private (and we should then remove private). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203866 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 5 years ago
31 changed file(s) with 38 addition(s) and 168 deletion(s). Raw diff Collapse all Expand all
687687 * ``weak_odr``: code 10
688688 * ``linkonce_odr``: code 11
689689 * ``available_externally``: code 12
690 * ``linker_private``: code 13
690 * deprecated : code 13
691 * deprecated : code 14
691692
692693 * alignment*: The logarithm base 2 of the variable's requested alignment, plus 1
693694
196196 private to be renamed as necessary to avoid collisions. Because the
197197 symbol is private to the module, all references can be updated. This
198198 doesn't show up in any symbol table in the object file.
199 ``linker_private``
200 Similar to ``private``, but the symbol is passed through the
201 assembler and evaluated by the linker. Unlike normal strong symbols,
202 they are removed by the linker from the final linked image
203 (executable or dynamic library).
204 ``linker_private_weak``
205 Similar to "``linker_private``", but the symbol is weak. Note that
206 ``linker_private_weak`` symbols are subject to coalescing by the
207 linker. The symbols are removed by the linker from the final linked
208 image (executable or dynamic library).
209199 ``internal``
210200 Similar to private, but the value shows as a local symbol
211201 (``STB_LOCAL`` in the case of ELF) in the object file. This
680670
681671 @ = [Visibility] [DLLStorageClass] alias [Linkage] @
682672
683 The linkage must be one of ``private``, ``linker_private``,
684 ``linker_private_weak``, ``internal``, ``linkonce``, ``weak``,
673 The linkage must be one of ``private``, ``internal``, ``linkonce``, ``weak``,
685674 ``linkonce_odr``, ``weak_odr``, ``external``. Note that some system linkers
686675 might not correctly handle dropping a weak symbol that is aliased by a non-weak
687676 alias.
3939 AppendingLinkage, ///< Special purpose, only applies to global arrays
4040 InternalLinkage, ///< Rename collisions when linking (static functions).
4141 PrivateLinkage, ///< Like Internal, but omit from symbol table.
42 LinkerPrivateLinkage, ///< Like Private, but linker removes.
43 LinkerPrivateWeakLinkage, ///< Like LinkerPrivate, but weak.
4442 ExternalWeakLinkage,///< ExternalWeak linkage description.
4543 CommonLinkage ///< Tentative definitions.
4644 };
157155 static bool isPrivateLinkage(LinkageTypes Linkage) {
158156 return Linkage == PrivateLinkage;
159157 }
160 static bool isLinkerPrivateLinkage(LinkageTypes Linkage) {
161 return Linkage == LinkerPrivateLinkage;
162 }
163 static bool isLinkerPrivateWeakLinkage(LinkageTypes Linkage) {
164 return Linkage == LinkerPrivateWeakLinkage;
165 }
166158 static bool isLocalLinkage(LinkageTypes Linkage) {
167 return isInternalLinkage(Linkage) || isPrivateLinkage(Linkage) ||
168 isLinkerPrivateLinkage(Linkage) || isLinkerPrivateWeakLinkage(Linkage);
159 return isInternalLinkage(Linkage) || isPrivateLinkage(Linkage);
169160 }
170161 static bool isExternalWeakLinkage(LinkageTypes Linkage) {
171162 return Linkage == ExternalWeakLinkage;
184175 /// by something non-equivalent at link time. For example, if a function has
185176 /// weak linkage then the code defining it may be replaced by different code.
186177 static bool mayBeOverridden(LinkageTypes Linkage) {
187 return Linkage == WeakAnyLinkage ||
188 Linkage == LinkOnceAnyLinkage ||
189 Linkage == CommonLinkage ||
190 Linkage == ExternalWeakLinkage ||
191 Linkage == LinkerPrivateWeakLinkage;
178 return Linkage == WeakAnyLinkage || Linkage == LinkOnceAnyLinkage ||
179 Linkage == CommonLinkage || Linkage == ExternalWeakLinkage;
192180 }
193181
194182 /// isWeakForLinker - Whether the definition of this global may be replaced at
196184 /// always a mistake: when working at the IR level use mayBeOverridden instead
197185 /// as it knows about ODR semantics.
198186 static bool isWeakForLinker(LinkageTypes Linkage) {
199 return Linkage == AvailableExternallyLinkage ||
200 Linkage == WeakAnyLinkage ||
201 Linkage == WeakODRLinkage ||
202 Linkage == LinkOnceAnyLinkage ||
203 Linkage == LinkOnceODRLinkage ||
204 Linkage == CommonLinkage ||
205 Linkage == ExternalWeakLinkage ||
206 Linkage == LinkerPrivateWeakLinkage;
187 return Linkage == AvailableExternallyLinkage || Linkage == WeakAnyLinkage ||
188 Linkage == WeakODRLinkage || Linkage == LinkOnceAnyLinkage ||
189 Linkage == LinkOnceODRLinkage || Linkage == CommonLinkage ||
190 Linkage == ExternalWeakLinkage;
207191 }
208192
209193 bool hasExternalLinkage() const { return isExternalLinkage(Linkage); }
219203 bool hasAppendingLinkage() const { return isAppendingLinkage(Linkage); }
220204 bool hasInternalLinkage() const { return isInternalLinkage(Linkage); }
221205 bool hasPrivateLinkage() const { return isPrivateLinkage(Linkage); }
222 bool hasLinkerPrivateLinkage() const { return isLinkerPrivateLinkage(Linkage); }
223 bool hasLinkerPrivateWeakLinkage() const {
224 return isLinkerPrivateWeakLinkage(Linkage);
225 }
226206 bool hasLocalLinkage() const { return isLocalLinkage(Linkage); }
227207 bool hasExternalWeakLinkage() const { return isExternalWeakLinkage(Linkage); }
228208 bool hasCommonLinkage() const { return isCommonLinkage(Linkage); }
479479 KEYWORD(global); KEYWORD(constant);
480480
481481 KEYWORD(private);
482 KEYWORD(linker_private);
483 KEYWORD(linker_private_weak);
484482 KEYWORD(internal);
485483 KEYWORD(available_externally);
486484 KEYWORD(linkonce);
245245 // OptionalThreadLocal OptionalAddrSpace OptionalUnNammedAddr
246246 // ('constant'|'global') ...
247247 case lltok::kw_private: // OptionalLinkage
248 case lltok::kw_linker_private: // OptionalLinkage
249 case lltok::kw_linker_private_weak: // OptionalLinkage
250248 case lltok::kw_internal: // OptionalLinkage
251249 case lltok::kw_weak: // OptionalLinkage
252250 case lltok::kw_weak_odr: // OptionalLinkage
12771275 /// ParseOptionalLinkage
12781276 /// ::= /*empty*/
12791277 /// ::= 'private'
1280 /// ::= 'linker_private'
1281 /// ::= 'linker_private_weak'
12821278 /// ::= 'internal'
12831279 /// ::= 'weak'
12841280 /// ::= 'weak_odr'
12941290 switch (Lex.getKind()) {
12951291 default: Res=GlobalValue::ExternalLinkage; return false;
12961292 case lltok::kw_private: Res = GlobalValue::PrivateLinkage; break;
1297 case lltok::kw_linker_private: Res = GlobalValue::LinkerPrivateLinkage; break;
1298 case lltok::kw_linker_private_weak:
1299 Res = GlobalValue::LinkerPrivateWeakLinkage;
1300 break;
13011293 case lltok::kw_internal: Res = GlobalValue::InternalLinkage; break;
13021294 case lltok::kw_weak: Res = GlobalValue::WeakAnyLinkage; break;
13031295 case lltok::kw_weak_odr: Res = GlobalValue::WeakODRLinkage; break;
29912983 return Error(LinkageLoc, "invalid linkage for function definition");
29922984 break;
29932985 case GlobalValue::PrivateLinkage:
2994 case GlobalValue::LinkerPrivateLinkage:
2995 case GlobalValue::LinkerPrivateWeakLinkage:
29962986 case GlobalValue::InternalLinkage:
29972987 case GlobalValue::AvailableExternallyLinkage:
29982988 case GlobalValue::LinkOnceAnyLinkage:
3636 kw_declare, kw_define,
3737 kw_global, kw_constant,
3838
39 kw_private, kw_linker_private, kw_linker_private_weak,
39 kw_private,
4040 kw_internal,
4141 kw_linkonce, kw_linkonce_odr,
4242 kw_weak, kw_weak_odr, kw_appending,
8787 case 10: return GlobalValue::WeakODRLinkage;
8888 case 11: return GlobalValue::LinkOnceODRLinkage;
8989 case 12: return GlobalValue::AvailableExternallyLinkage;
90 case 13: return GlobalValue::LinkerPrivateLinkage;
91 case 14: return GlobalValue::LinkerPrivateWeakLinkage;
90 case 13:
91 return GlobalValue::PrivateLinkage; // Obsolete LinkerPrivateLinkage
92 case 14:
93 return GlobalValue::PrivateLinkage; // Obsolete LinkerPrivateWeakLinkage
9294 }
9395 }
9496
486486 case GlobalValue::WeakODRLinkage: return 10;
487487 case GlobalValue::LinkOnceODRLinkage: return 11;
488488 case GlobalValue::AvailableExternallyLinkage: return 12;
489 case GlobalValue::LinkerPrivateLinkage: return 13;
490 case GlobalValue::LinkerPrivateWeakLinkage: return 14;
491489 }
492490 llvm_unreachable("Invalid linkage");
493491 }
271271 case GlobalValue::LinkOnceODRLinkage:
272272 case GlobalValue::WeakAnyLinkage:
273273 case GlobalValue::WeakODRLinkage:
274 case GlobalValue::LinkerPrivateWeakLinkage:
275274 if (MAI->hasWeakDefDirective()) {
276275 // .globl _foo
277276 OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global);
300299 return;
301300 case GlobalValue::PrivateLinkage:
302301 case GlobalValue::InternalLinkage:
303 case GlobalValue::LinkerPrivateLinkage:
304302 return;
305303 case GlobalValue::AvailableExternallyLinkage:
306304 llvm_unreachable("Should never emit this");
13901390 switch (LT) {
13911391 case GlobalValue::ExternalLinkage: break;
13921392 case GlobalValue::PrivateLinkage: Out << "private "; break;
1393 case GlobalValue::LinkerPrivateLinkage: Out << "linker_private "; break;
1394 case GlobalValue::LinkerPrivateWeakLinkage:
1395 Out << "linker_private_weak ";
1396 break;
13971393 case GlobalValue::InternalLinkage: Out << "internal "; break;
13981394 case GlobalValue::LinkOnceAnyLinkage: Out << "linkonce "; break;
13991395 case GlobalValue::LinkOnceODRLinkage: Out << "linkonce_odr "; break;
11581158 return LLVMInternalLinkage;
11591159 case GlobalValue::PrivateLinkage:
11601160 return LLVMPrivateLinkage;
1161 case GlobalValue::LinkerPrivateLinkage:
1162 return LLVMLinkerPrivateLinkage;
1163 case GlobalValue::LinkerPrivateWeakLinkage:
1164 return LLVMLinkerPrivateWeakLinkage;
11651161 case GlobalValue::ExternalWeakLinkage:
11661162 return LLVMExternalWeakLinkage;
11671163 case GlobalValue::CommonLinkage:
12071203 GV->setLinkage(GlobalValue::PrivateLinkage);
12081204 break;
12091205 case LLVMLinkerPrivateLinkage:
1210 GV->setLinkage(GlobalValue::LinkerPrivateLinkage);
1206 GV->setLinkage(GlobalValue::PrivateLinkage);
12111207 break;
12121208 case LLVMLinkerPrivateWeakLinkage:
1213 GV->setLinkage(GlobalValue::LinkerPrivateWeakLinkage);
1209 GV->setLinkage(GlobalValue::PrivateLinkage);
12141210 break;
12151211 case LLVMDLLImportLinkage:
12161212 DEBUG(errs()
8383 PrefixTy = Mangler::LinkerPrivate;
8484 else
8585 PrefixTy = Mangler::Private;
86 } else if (GV->hasLinkerPrivateLinkage() ||
87 GV->hasLinkerPrivateWeakLinkage()) {
88 PrefixTy = Mangler::LinkerPrivate;
8986 }
9087
9188 if (!GV->hasName()) {
407407 }
408408
409409 // set definition part
410 if (def->hasWeakLinkage() || def->hasLinkOnceLinkage() ||
411 def->hasLinkerPrivateWeakLinkage())
410 if (def->hasWeakLinkage() || def->hasLinkOnceLinkage())
412411 attr |= LTO_SYMBOL_DEFINITION_WEAK;
413412 else if (def->hasCommonLinkage())
414413 attr |= LTO_SYMBOL_DEFINITION_TENTATIVE;
423422 else if (canBeHidden(def))
424423 attr |= LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN;
425424 else if (def->hasExternalLinkage() || def->hasWeakLinkage() ||
426 def->hasLinkOnceLinkage() || def->hasCommonLinkage() ||
427 def->hasLinkerPrivateWeakLinkage())
425 def->hasLinkOnceLinkage() || def->hasCommonLinkage())
428426 attr |= LTO_SYMBOL_SCOPE_DEFAULT;
429427 else
430428 attr |= LTO_SYMBOL_SCOPE_INTERNAL;
109109 uint32_t Res = BasicSymbolRef::SF_None;
110110 if (GV.isDeclaration() || GV.hasAvailableExternallyLinkage())
111111 Res |= BasicSymbolRef::SF_Undefined;
112 if (GV.hasPrivateLinkage() || GV.hasLinkerPrivateLinkage() ||
113 GV.hasLinkerPrivateWeakLinkage())
112 if (GV.hasPrivateLinkage())
114113 Res |= BasicSymbolRef::SF_FormatSpecific;
115114 if (!GV.hasLocalLinkage())
116115 Res |= BasicSymbolRef::SF_Global;
282282 Out << "GlobalValue::InternalLinkage"; break;
283283 case GlobalValue::PrivateLinkage:
284284 Out << "GlobalValue::PrivateLinkage"; break;
285 case GlobalValue::LinkerPrivateLinkage:
286 Out << "GlobalValue::LinkerPrivateLinkage"; break;
287 case GlobalValue::LinkerPrivateWeakLinkage:
288 Out << "GlobalValue::LinkerPrivateWeakLinkage"; break;
289285 case GlobalValue::AvailableExternallyLinkage:
290286 Out << "GlobalValue::AvailableExternallyLinkage "; break;
291287 case GlobalValue::LinkOnceAnyLinkage:
1616 ; CHECK: @private.var = private constant i32 0
1717
1818 @linker_private.var = linker_private constant i32 0
19 ; CHECK: @linker_private.var = linker_private constant i32 0
19 ; CHECK: @linker_private.var = private constant i32 0
2020
2121 @linker_private_weak.var = linker_private_weak constant i32 0
22 ; CHECK: @linker_private_weak.var = linker_private_weak constant i32 0
22 ; CHECK: @linker_private_weak.var = private constant i32 0
2323
2424 @linker_private_weak_def_auto.var = linker_private_weak_def_auto constant i32 0
2525 ; CHECK: @linker_private_weak_def_auto.var = constant i32 0
5858 }
5959
6060 define linker_private void @linker_private()
61 ; CHECK: define linker_private void @linker_private
61 ; CHECK: define private void @linker_private
6262 {
6363 ret void;
6464 }
6565
6666 define linker_private_weak void @linker_private_weak()
67 ; CHECK: define linker_private_weak void @linker_private_weak
67 ; CHECK: define private void @linker_private_weak
6868 {
6969 ret void;
7070 }
+0
-8
test/CodeGen/ARM/2009-08-23-linkerprivate.ll less more
None ; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | FileCheck %s
1
2 ; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm'
3
4 @"\01l_objc_msgSend_fixup_alloc" = linker_private_weak hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16
5
6 ; CHECK: .globl l_objc_msgSend_fixup_alloc
7 ; CHECK: .weak_definition l_objc_msgSend_fixup_alloc
22 target triple = "thumbv7-apple-darwin10.0.0"
33
44 ; CHECK: align 3
5 @.v = linker_private unnamed_addr constant <4 x i32> , align 8
5 @.v = private unnamed_addr constant <4 x i32> , align 8
66 ; CHECK: align 2
7 @.strA = linker_private unnamed_addr constant [4 x i8] c"bar\00"
7 @.strA = private unnamed_addr constant [4 x i8] c"bar\00"
88 ; CHECK-NOT: align
9 @.strB = linker_private unnamed_addr constant [4 x i8] c"foo\00", align 1
10 @.strC = linker_private unnamed_addr constant [4 x i8] c"baz\00", section "__TEXT,__cstring,cstring_literals", align 1
9 @.strB = private unnamed_addr constant [4 x i8] c"foo\00", align 1
10 @.strC = private unnamed_addr constant [4 x i8] c"baz\00", section "__TEXT,__cstring,cstring_literals", align 1
33 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
44 target triple = "nvptx64-nvidia-cuda"
55
6 define linker_private ptx_device { double, double } @__utils1_MOD_trace(%"struct.array2_complex(kind=8).43.5.57"* noalias %m) {
6 define private ptx_device { double, double } @__utils1_MOD_trace(%"struct.array2_complex(kind=8).43.5.57"* noalias %m) {
77 entry:
88 ;unreachable
99 %t0 = insertvalue {double, double} undef, double 1.0, 0
+0
-8
test/CodeGen/PowerPC/2009-08-23-linkerprivate.ll less more
None ; RUN: llc < %s -march=ppc32 -mtriple=powerpc-apple-darwin | FileCheck %s
1
2 ; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm'
3
4 @"\01l_objc_msgSend_fixup_alloc" = linker_private_weak hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16
5
6 ; CHECK: .globl l_objc_msgSend_fixup_alloc
7 ; CHECK: .weak_definition l_objc_msgSend_fixup_alloc
1010
1111 @_ZTIi = external constant %struct.__fundamental_type_info_pseudo
1212 @_ZTIf = external constant %struct.__fundamental_type_info_pseudo
13 @.cst = linker_private unnamed_addr constant [12 x i8] c"catched int\00", align 64
14 @.cst1 = linker_private unnamed_addr constant [14 x i8] c"catched float\00", align 64
13 @.cst = private unnamed_addr constant [12 x i8] c"catched int\00", align 64
14 @.cst1 = private unnamed_addr constant [14 x i8] c"catched float\00", align 64
1515
1616 ; V8ABS-LABEL: main:
1717 ; V8ABS: .cfi_startproc
66 %struct.__jmp_buf_tag = type { [3 x i32], i32, %0 }
77
88 @jenv = common unnamed_addr global %struct.jmpbuf_env* null
9 @.cst = linker_private unnamed_addr constant [30 x i8] c"in bar with jmp_buf's id: %d\0A\00", align 64
9 @.cst = private unnamed_addr constant [30 x i8] c"in bar with jmp_buf's id: %d\0A\00", align 64
1010
1111 ; CHECK-LABEL: foo
1212 ; CHECK-DAG: st {{.+}}, [%i0]
+0
-8
test/CodeGen/X86/2009-08-23-linkerprivate.ll less more
None ; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin | FileCheck %s
1
2 ; ModuleID = '/Volumes/MacOS9/tests/WebKit/JavaScriptCore/profiler/ProfilerServer.mm'
3
4 @"\01l_objc_msgSend_fixup_alloc" = linker_private_weak hidden global i32 0, section "__DATA, __objc_msgrefs, coalesced", align 16
5
6 ; CHECK: .globl l_objc_msgSend_fixup_alloc
7 ; CHECK: .weak_definition l_objc_msgSend_fixup_alloc
66 ; Make sure that the string ends up the correct section.
77
88 ; CHECK: .section __TEXT,__cstring
9 ; CHECK-NEXT: l_.str3:
9 ; CHECK-NEXT: L_.str3:
1010
1111 ; CHECK: .section __DATA,__cfstring
1212 ; CHECK-NEXT: .align 4
1414 ; CHECK-NEXT: .quad ___CFConstantStringClassReference
1515 ; CHECK-NEXT: .long 1992
1616 ; CHECK-NEXT: .space 4
17 ; CHECK-NEXT: .quad l_.str3
17 ; CHECK-NEXT: .quad L_.str3
1818 ; CHECK-NEXT: .long 0
1919 ; CHECK-NEXT: .space 4
2020
2121 @isLogVisible = global i8 0, align 1
2222 @__CFConstantStringClassReference = external global [0 x i32]
23 @.str3 = linker_private unnamed_addr constant [1 x i8] zeroinitializer, align 1
23 @.str3 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
2424 @_unnamed_cfstring_4 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([1 x i8]* @.str3, i32 0, i32 0), i32 0 }, section "__DATA,__cfstring"
2525 @null.array = weak_odr constant [1 x i8] zeroinitializer, align 1
2626
+0
-10
test/CodeGen/X86/linker-private.ll less more
None ; RUN: llc < %s -mtriple=x86_64-pc-linux | FileCheck --check-prefix=ELF %s
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck --check-prefix=MACHO %s
2
3 @foo = linker_private global i32 42
4 ;ELF: {{^}}.Lfoo:
5 ;MACHO: {{^}}l_foo:
6
7 define i32* @f() {
8 ret i32* @foo
9 }
+0
-6
test/Feature/linker_private_linkages.ll less more
None ; RUN: llvm-as < %s | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4 @foo = linker_private hidden global i32 0
5 @bar = linker_private_weak hidden global i32 0
+0
-23
test/Transforms/ConstantMerge/linker-private.ll less more
None ; RUN: opt < %s -constmerge -S | FileCheck %s
1 ;
2
3 %0 = type opaque
4 %struct.NSConstantString = type { i32*, i32, i8*, i32 }
5
6 ; CHECK: @.str3 = linker_private unnamed_addr constant [1 x i8] zeroinitializer, align 1
7
8 @isLogVisible = global i8 0, align 1
9 @__CFConstantStringClassReference = external global [0 x i32]
10 @.str3 = linker_private unnamed_addr constant [1 x i8] zeroinitializer, align 1
11 @_unnamed_cfstring_4 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([1 x i8]* @.str3, i32 0, i32 0), i32 0 }, section "__DATA,__cfstring"
12 @null.array = weak_odr constant [1 x i8] zeroinitializer, align 1
13
14 define linkonce_odr void @bar() nounwind ssp align 2 {
15 entry:
16 %stack = alloca i8*, align 4
17 %call = call %0* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to %0* (i8*, i8*, %0*)*)(i8* null, i8* null, %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_4 to %0*))
18 store i8* getelementptr inbounds ([1 x i8]* @null.array, i32 0, i32 0), i8** %stack, align 4
19 ret void
20 }
21
22 declare i8* @objc_msgSend(i8*, i8*, ...) nonlazybind
2323 @"\01L_OBJC_METH_VAR_NAME_" = internal global [4 x i8] c"new\00", section "__TEXT,__objc_methname,cstring_literals", align 1
2424 @"\01L_OBJC_SELECTOR_REFERENCES_" = internal global i8* getelementptr inbounds ([4 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
2525 @__CFConstantStringClassReference = external global [0 x i32]
26 @.str = linker_private unnamed_addr constant [11 x i8] c"Failed: %@\00", align 1
26 @.str = private unnamed_addr constant [11 x i8] c"Failed: %@\00", align 1
2727 @_unnamed_cfstring_ = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([11 x i8]* @.str, i32 0, i32 0), i64 10 }, section "__DATA,__cfstring"
2828 @"OBJC_CLASS_$_NSException" = external global %struct._class_t
2929 @"\01L_OBJC_CLASSLIST_REFERENCES_$_1" = internal global %struct._class_t* @"OBJC_CLASS_$_NSException", section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8
30 @.str2 = linker_private unnamed_addr constant [4 x i8] c"Foo\00", align 1
30 @.str2 = private unnamed_addr constant [4 x i8] c"Foo\00", align 1
3131 @_unnamed_cfstring_3 = private constant %struct.NSConstantString { i32* getelementptr inbounds ([0 x i32]* @__CFConstantStringClassReference, i32 0, i32 0), i32 1992, i8* getelementptr inbounds ([4 x i8]* @.str2, i32 0, i32 0), i64 3 }, section "__DATA,__cfstring"
3232 @"\01L_OBJC_METH_VAR_NAME_4" = internal global [14 x i8] c"raise:format:\00", section "__TEXT,__objc_methname,cstring_literals", align 1
3333 @"\01L_OBJC_SELECTOR_REFERENCES_5" = internal global i8* getelementptr inbounds ([14 x i8]* @"\01L_OBJC_METH_VAR_NAME_4", i64 0, i64 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip"
3838
3939
4040 private
41 linker_private
42 linker_private_weak
4341 internal
4442 available_externally
4543 linkonce
9191 | dllexport
9292 | common
9393 | private
94 | "linker_private"
95 | "linker_private_weak"
9694 ;
9795
9896 GVExternalLinkage
4242 syn keyword llvmKeyword constant datalayout declare default define deplibs
4343 syn keyword llvmKeyword dllexport dllimport except extern_weak external fastcc
4444 syn keyword llvmKeyword filter gc global hidden initialexec inlinehint inreg
45 syn keyword llvmKeyword intel_ocl_bicc inteldialect internal linker_private
46 syn keyword llvmKeyword linker_private_weak
45 syn keyword llvmKeyword intel_ocl_bicc inteldialect internal
4746 syn keyword llvmKeyword linkonce linkonce_odr
4847 syn keyword llvmKeyword localdynamic localexec minsize module monotonic
4948 syn keyword llvmKeyword msp430_intrcc naked nest noalias nocapture