llvm.org GIT mirror llvm / 9a92586
Revert r201622 and r201608. This causes the LLVMgold plugin to segfault. More information on the replies to r201608. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201669 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Jasper 6 years ago
31 changed file(s) with 160 addition(s) and 346 deletion(s). Raw diff Collapse all Expand all
160160 /// getCurrentSection() - Return the current section we are emitting to.
161161 const MCSection *getCurrentSection() const;
162162
163 void getNameWithPrefix(SmallVectorImpl &Name,
164 const GlobalValue *GV) const;
165
166163 MCSymbol *getSymbol(const GlobalValue *GV) const;
167164
168165 //===------------------------------------------------------------------===//
5656
5757 /// Return an MCExpr to use for a reference to the specified type info global
5858 /// variable from exception handling information.
59 const MCExpr *
60 getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
61 Mangler &Mang, const TargetMachine &TM,
62 MachineModuleInfo *MMI, MCStreamer &Streamer) const
59 const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
60 unsigned Encoding, Mangler &Mang,
61 MachineModuleInfo *MMI,
62 MCStreamer &Streamer) const
6363 LLVM_OVERRIDE;
6464
6565 // The symbol that gets passed to .cfi_personality.
6666 MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
67 const TargetMachine &TM,
6867 MachineModuleInfo *MMI) const LLVM_OVERRIDE;
6968
7069 void InitializeELF(bool UseInitArray_);
9089 Mangler &Mang, const TargetMachine &TM) const
9190 LLVM_OVERRIDE;
9291
93 bool isSectionAtomizableBySymbols(const MCSection &Section) const
94 LLVM_OVERRIDE;
95
9692 const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
9793 SectionKind Kind, Mangler &Mang,
9894 const TargetMachine &TM) const
108104 /// This hook allows targets to selectively decide not to emit the
109105 /// UsedDirective for some symbols in llvm.used.
110106 /// FIXME: REMOVE this (rdar://7071300)
111 bool shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler &Mang,
112 TargetMachine &TM) const LLVM_OVERRIDE;
107 bool shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler &Mang) const
108 LLVM_OVERRIDE;
113109
114110 /// The mach-o version of this method defaults to returning a stub reference.
115 const MCExpr *
116 getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
117 Mangler &Mang, const TargetMachine &TM,
118 MachineModuleInfo *MMI, MCStreamer &Streamer) const
111 const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
112 unsigned Encoding, Mangler &Mang,
113 MachineModuleInfo *MMI,
114 MCStreamer &Streamer) const
119115 LLVM_OVERRIDE;
120116
121117 // The symbol that gets passed to .cfi_personality.
122118 MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
123 const TargetMachine &TM,
124119 MachineModuleInfo *MMI) const LLVM_OVERRIDE;
125120 };
126121
5050 /// Print the appropriate prefix and the specified global variable's name.
5151 /// If the global variable doesn't have a name, this fills in a unique name
5252 /// for the global.
53 void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV,
54 bool CannotUsePrivateLabel) const;
55 void getNameWithPrefix(SmallVectorImpl &OutName, const GlobalValue *GV,
56 bool CannotUsePrivateLabel) const;
53 void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV) const;
54 void getNameWithPrefix(SmallVectorImpl &OutName,
55 const GlobalValue *GV) const;
5756
5857 /// Print the appropriate prefix and the specified name as the global variable
5958 /// name. GVName must not be empty.
4747 class MachineFunction;
4848 class MachineInstr;
4949 class MachineJumpTableInfo;
50 class Mangler;
5150 class MCContext;
5251 class MCExpr;
53 class MCSymbol;
5452 template class SmallVectorImpl;
5553 class DataLayout;
5654 class TargetRegisterClass;
13441342 return LibcallCallingConvs[Call];
13451343 }
13461344
1347 void getNameWithPrefix(SmallVectorImpl &Name, const GlobalValue *GV,
1348 Mangler &Mang, bool MayAlwaysUsePrivate = false) const;
1349 MCSymbol *getSymbol(const GlobalValue *GV, Mangler &Mang) const;
1350
13511345 private:
13521346 const TargetMachine &TM;
13531347 const DataLayout *DL;
7070 /// This hook allows targets to selectively decide not to emit the
7171 /// UsedDirective for some symbols in llvm.used.
7272 /// FIXME: REMOVE this (rdar://7071300)
73 virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler &Mang,
74 TargetMachine &TM) const {
73 virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
74 Mangler &Mang) const {
7575 return GV != 0;
7676 }
7777
116116
117117 /// Return an MCExpr to use for a reference to the specified global variable
118118 /// from exception handling information.
119 virtual const MCExpr *
120 getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
121 Mangler &Mang, const TargetMachine &TM,
122 MachineModuleInfo *MMI, MCStreamer &Streamer) const;
119 virtual const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
120 unsigned Encoding,
121 Mangler &Mang,
122 MachineModuleInfo *MMI,
123 MCStreamer &Streamer) const;
124
125 /// Return the MCSymbol for the specified global value. This symbol is the
126 /// main label that is the address of the global
127 MCSymbol *getSymbol(const GlobalValue *GV, Mangler &M) const;
123128
124129 /// Return the MCSymbol for a private symbol with global value name as its
125130 /// base, with the specified suffix.
126131 MCSymbol *getSymbolWithGlobalValueBase(const GlobalValue *GV,
127 StringRef Suffix, Mangler &Mang,
128 const TargetMachine &TM) const;
132 StringRef Suffix, Mangler &M) const;
129133
130134 // The symbol that gets passed to .cfi_personality.
131 virtual MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV,
132 Mangler &Mang,
133 const TargetMachine &TM,
134 MachineModuleInfo *MMI) const;
135 virtual MCSymbol *
136 getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
137 MachineModuleInfo *MMI) const;
135138
136139 const MCExpr *
137140 getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding,
153156 virtual const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const;
154157
155158 virtual const MCExpr *
156 getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang,
157 const TargetMachine &TM) const {
159 getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang) const {
158160 return 0;
159161 }
160
161 /// \brief True if the section is atomized using the symbols in it.
162 /// This is false if the section is not atomized at all (most ELF sections) or
163 /// if it is atomized based on its contents (MachO' __TEXT,__cstring for
164 /// example).
165 virtual bool isSectionAtomizableBySymbols(const MCSection &Section) const;
166162
167163 protected:
168164 virtual const MCSection *
310310 llvm_unreachable("Unknown linkage type!");
311311 }
312312
313 void AsmPrinter::getNameWithPrefix(SmallVectorImpl &Name,
314 const GlobalValue *GV) const {
315 TM.getTargetLowering()->getNameWithPrefix(Name, GV, *Mang);
316 }
317
318313 MCSymbol *AsmPrinter::getSymbol(const GlobalValue *GV) const {
319 return TM.getTargetLowering()->getSymbol(GV, *Mang);
314 return getObjFileLowering().getSymbol(GV, *Mang);
320315 }
321316
322317 /// EmitGlobalVariable - Emit the specified global variable to the .s file.
13731368 for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
13741369 const GlobalValue *GV =
13751370 dyn_cast(InitList->getOperand(i)->stripPointerCasts());
1376 if (GV && getObjFileLowering().shouldEmitUsedDirectiveFor(GV, *Mang, TM))
1371 if (GV && getObjFileLowering().shouldEmitUsedDirectiveFor(GV, *Mang))
13771372 OutStreamer.EmitSymbolAttribute(getSymbol(GV), MCSA_NoDeadStrip);
13781373 }
13791374 }
15781573 }
15791574
15801575 if (const MCExpr *RelocExpr =
1581 AP.getObjFileLowering().getExecutableRelativeSymbol(CE, *AP.Mang,
1582 AP.TM))
1576 AP.getObjFileLowering().getExecutableRelativeSymbol(CE, *AP.Mang))
15831577 return RelocExpr;
15841578
15851579 switch (CE->getOpcode()) {
21082102
21092103 MCSymbol *AsmPrinter::getSymbolWithGlobalValueBase(const GlobalValue *GV,
21102104 StringRef Suffix) const {
2111 return getObjFileLowering().getSymbolWithGlobalValueBase(GV, Suffix, *Mang,
2112 TM);
2105 return getObjFileLowering().getSymbolWithGlobalValueBase(GV, Suffix, *Mang);
21132106 }
21142107
21152108 /// GetExternalSymbolSymbol - Return the MCSymbol for the specified
142142 const TargetLoweringObjectFile &TLOF = getObjFileLowering();
143143
144144 const MCExpr *Exp =
145 TLOF.getTTypeGlobalReference(GV, Encoding, *Mang, TM, MMI, OutStreamer);
145 TLOF.getTTypeGlobalReference(GV, Encoding, *Mang, MMI, OutStreamer);
146146 OutStreamer.EmitValue(Exp, GetSizeOfEncodedValue(Encoding));
147147 } else
148148 OutStreamer.EmitIntValue(0, GetSizeOfEncodedValue(Encoding));
118118 if (!shouldEmitPersonality)
119119 return;
120120
121 const MCSymbol *Sym =
122 TLOF.getCFIPersonalitySymbol(Per, *Asm->Mang, Asm->TM, MMI);
121 const MCSymbol *Sym = TLOF.getCFIPersonalitySymbol(Per, *Asm->Mang, MMI);
123122 Asm->OutStreamer.EmitCFIPersonality(Sym, PerEncoding);
124123
125124 Asm->OutStreamer.EmitDebugLabel
100100 if (shouldEmitPersonality) {
101101 const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
102102 const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
103 const MCSymbol *Sym =
104 TLOF.getCFIPersonalitySymbol(Per, *Asm->Mang, Asm->TM, MMI);
103 const MCSymbol *Sym = TLOF.getCFIPersonalitySymbol(Per, *Asm->Mang, MMI);
105104
106105 Asm->OutStreamer.PushSection();
107106 Asm->OutStreamer.EmitWin64EHHandlerData();
2323 #include "llvm/IR/DataLayout.h"
2424 #include "llvm/IR/DerivedTypes.h"
2525 #include "llvm/IR/GlobalVariable.h"
26 #include "llvm/IR/Mangler.h"
2726 #include "llvm/MC/MCAsmInfo.h"
28 #include "llvm/MC/MCContext.h"
2927 #include "llvm/MC/MCExpr.h"
3028 #include "llvm/Support/CommandLine.h"
3129 #include "llvm/Support/ErrorHandling.h"
14271425
14281426 return true;
14291427 }
1430
1431 void TargetLoweringBase::getNameWithPrefix(SmallVectorImpl &Name,
1432 const GlobalValue *GV,
1433 Mangler &Mang,
1434 bool MayAlwaysUsePrivate) const {
1435 if (MayAlwaysUsePrivate || !GV->hasPrivateLinkage()) {
1436 // Simple case: If GV is not private, it is not important to find out if
1437 // private labels are legal in this case or not.
1438 Mang.getNameWithPrefix(Name, GV, false);
1439 return;
1440 }
1441 SectionKind GVKind =
1442 TargetLoweringObjectFile::getKindForGlobal(GV, getTargetMachine());
1443 const TargetLoweringObjectFile &TLOF = getObjFileLowering();
1444 const MCSection *TheSection =
1445 TLOF.SectionForGlobal(GV, GVKind, Mang, getTargetMachine());
1446 bool CannotUsePrivateLabel = TLOF.isSectionAtomizableBySymbols(*TheSection);
1447 Mang.getNameWithPrefix(Name, GV, CannotUsePrivateLabel);
1448 }
1449
1450 MCSymbol *TargetLoweringBase::getSymbol(const GlobalValue *GV,
1451 Mangler &Mang) const {
1452 SmallString<60> NameStr;
1453 getNameWithPrefix(NameStr, GV, Mang);
1454 const TargetLoweringObjectFile &TLOF = getObjFileLowering();
1455 return TLOF.getContext().GetOrCreateSymbol(NameStr.str());
1456 }
3535 #include "llvm/Support/ErrorHandling.h"
3636 #include "llvm/Support/raw_ostream.h"
3737 #include "llvm/Target/TargetMachine.h"
38 #include "llvm/Target/TargetLowering.h"
3938 using namespace llvm;
4039 using namespace dwarf;
4140
4342 // ELF
4443 //===----------------------------------------------------------------------===//
4544
46 MCSymbol *TargetLoweringObjectFileELF::getCFIPersonalitySymbol(
47 const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM,
48 MachineModuleInfo *MMI) const {
45 MCSymbol *
46 TargetLoweringObjectFileELF::getCFIPersonalitySymbol(const GlobalValue *GV,
47 Mangler &Mang,
48 MachineModuleInfo *MMI) const {
4949 unsigned Encoding = getPersonalityEncoding();
5050 switch (Encoding & 0x70) {
5151 default:
5252 report_fatal_error("We do not support this DWARF encoding yet!");
5353 case dwarf::DW_EH_PE_absptr:
54 return TM.getTargetLowering()->getSymbol(GV, Mang);
54 return getSymbol(GV, Mang);
5555 case dwarf::DW_EH_PE_pcrel: {
5656 return getContext().GetOrCreateSymbol(StringRef("DW.ref.") +
57 TM.getTargetLowering()->getSymbol(GV, Mang)->getName());
57 getSymbol(GV, Mang)->getName());
5858 }
5959 }
6060 }
8888
8989 const MCExpr *TargetLoweringObjectFileELF::getTTypeGlobalReference(
9090 const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
91 const TargetMachine &TM, MachineModuleInfo *MMI,
92 MCStreamer &Streamer) const {
91 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
9392
9493 if (Encoding & dwarf::DW_EH_PE_indirect) {
9594 MachineModuleInfoELF &ELFMMI = MMI->getObjFileInfo();
9695
97 MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, ".DW.stub", Mang, TM);
96 MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, ".DW.stub", Mang);
9897
9998 // Add information about the stub reference to ELFMMI so that the stub
10099 // gets emitted by the asmprinter.
101100 MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym);
102101 if (StubSym.getPointer() == 0) {
103 MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
102 MCSymbol *Sym = getSymbol(GV, Mang);
104103 StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
105104 }
106105
109108 Encoding & ~dwarf::DW_EH_PE_indirect, Streamer);
110109 }
111110
112 return TargetLoweringObjectFile::
113 getTTypeGlobalReference(GV, Encoding, Mang, TM, MMI, Streamer);
111 return TargetLoweringObjectFile::getTTypeGlobalReference(GV, Encoding, Mang,
112 MMI, Streamer);
114113 }
115114
116115 static SectionKind
195194 return Flags;
196195 }
197196
198 const MCSection *TargetLoweringObjectFileELF::getExplicitSectionGlobal(
199 const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
200 const TargetMachine &TM) const {
197
198 const MCSection *TargetLoweringObjectFileELF::
199 getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
200 Mangler &Mang, const TargetMachine &TM) const {
201201 StringRef SectionName = GV->getSection();
202202
203203 // Infer section flags from the section name if we can.
247247 Prefix = getSectionPrefixForGlobal(Kind);
248248
249249 SmallString<128> Name(Prefix, Prefix+strlen(Prefix));
250 TM.getTargetLowering()->getNameWithPrefix(Name, GV, Mang, true);
251
250 MCSymbol *Sym = getSymbol(GV, Mang);
251 Name.append(Sym->getName().begin(), Sym->getName().end());
252252 StringRef Group = "";
253253 unsigned Flags = getELFSectionFlags(Kind);
254254 if (GV->isWeakForLinker()) {
255 Group = Name.substr(strlen(Prefix));
255 Group = Sym->getName();
256256 Flags |= ELF::SHF_GROUP;
257257 }
258258
486486 Streamer.AddBlankLine();
487487 }
488488
489 const MCSection *TargetLoweringObjectFileMachO::getExplicitSectionGlobal(
490 const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
491 const TargetMachine &TM) const {
489 const MCSection *TargetLoweringObjectFileMachO::
490 getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
491 Mangler &Mang, const TargetMachine &TM) const {
492492 // Parse the section specifier and create it if valid.
493493 StringRef Segment, Section;
494494 unsigned TAA = 0, StubSize = 0;
525525 return S;
526526 }
527527
528 bool TargetLoweringObjectFileMachO::isSectionAtomizableBySymbols(
529 const MCSection &Section) const {
530 const MCSectionMachO &SMO = static_cast(Section);
531
532 // Sections holding 1 byte strings are atomized based on the data
533 // they contain.
534 // Sections holding 2 byte strings require symbols in order to be
535 // atomized.
536 // There is no dedicated section for 4 byte strings.
537 if (SMO.getKind().isMergeable1ByteCString())
538 return false;
539
540 if (SMO.getSegmentName() == "__DATA" &&
541 SMO.getSectionName() == "__cfstring")
542 return false;
543
544 switch (SMO.getType()) {
545 default:
546 return true;
547
548 // These sections are atomized at the element boundaries without using
549 // symbols.
550 case MCSectionMachO::S_4BYTE_LITERALS:
551 case MCSectionMachO::S_8BYTE_LITERALS:
552 case MCSectionMachO::S_16BYTE_LITERALS:
553 case MCSectionMachO::S_LITERAL_POINTERS:
554 case MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS:
555 case MCSectionMachO::S_LAZY_SYMBOL_POINTERS:
556 case MCSectionMachO::S_MOD_INIT_FUNC_POINTERS:
557 case MCSectionMachO::S_MOD_TERM_FUNC_POINTERS:
558 case MCSectionMachO::S_INTERPOSING:
559 return false;
560 }
561 }
562
563528 const MCSection *TargetLoweringObjectFileMachO::
564529 SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
565530 Mangler &Mang, const TargetMachine &TM) const {
640605 return ReadOnlySection; // .const
641606 }
642607
643 /// This hook allows targets to selectively decide not to emit the UsedDirective
644 /// for some symbols in llvm.used.
608 /// shouldEmitUsedDirectiveFor - This hook allows targets to selectively decide
609 /// not to emit the UsedDirective for some symbols in llvm.used.
645610 // FIXME: REMOVE this (rdar://7071300)
646 bool TargetLoweringObjectFileMachO::shouldEmitUsedDirectiveFor(
647 const GlobalValue *GV, Mangler &Mang, TargetMachine &TM) const {
611 bool TargetLoweringObjectFileMachO::
612 shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler &Mang) const {
613 /// On Darwin, internally linked data beginning with "L" or "l" does not have
614 /// the directive emitted (this occurs in ObjC metadata).
615 if (!GV) return false;
616
648617 // Check whether the mangled name has the "Private" or "LinkerPrivate" prefix.
649618 if (GV->hasLocalLinkage() && !isa(GV)) {
650619 // FIXME: ObjC metadata is currently emitted as internal symbols that have
651620 // \1L and \0l prefixes on them. Fix them to be Private/LinkerPrivate and
652621 // this horrible hack can go away.
653 MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
622 MCSymbol *Sym = getSymbol(GV, Mang);
654623 if (Sym->getName()[0] == 'L' || Sym->getName()[0] == 'l')
655624 return false;
656625 }
660629
661630 const MCExpr *TargetLoweringObjectFileMachO::getTTypeGlobalReference(
662631 const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
663 const TargetMachine &TM, MachineModuleInfo *MMI,
664 MCStreamer &Streamer) const {
632 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
665633 // The mach-o version of this method defaults to returning a stub reference.
666634
667635 if (Encoding & DW_EH_PE_indirect) {
668636 MachineModuleInfoMachO &MachOMMI =
669637 MMI->getObjFileInfo();
670638
671 MCSymbol *SSym =
672 getSymbolWithGlobalValueBase(GV, "$non_lazy_ptr", Mang, TM);
639 MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, "$non_lazy_ptr", Mang);
673640
674641 // Add information about the stub reference to MachOMMI so that the stub
675642 // gets emitted by the asmprinter.
677644 GV->hasHiddenVisibility() ? MachOMMI.getHiddenGVStubEntry(SSym) :
678645 MachOMMI.getGVStubEntry(SSym);
679646 if (StubSym.getPointer() == 0) {
680 MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
647 MCSymbol *Sym = getSymbol(GV, Mang);
681648 StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
682649 }
683650
686653 Encoding & ~dwarf::DW_EH_PE_indirect, Streamer);
687654 }
688655
689 return TargetLoweringObjectFile::getTTypeGlobalReference(GV, Encoding, Mang,
690 TM, MMI, Streamer);
691 }
692
693 MCSymbol *TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(
694 const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM,
695 MachineModuleInfo *MMI) const {
656 return TargetLoweringObjectFile::
657 getTTypeGlobalReference(GV, Encoding, Mang, MMI, Streamer);
658 }
659
660 MCSymbol *TargetLoweringObjectFileMachO::
661 getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
662 MachineModuleInfo *MMI) const {
696663 // The mach-o version of this method defaults to returning a stub reference.
697664 MachineModuleInfoMachO &MachOMMI =
698665 MMI->getObjFileInfo();
699666
700 MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, "$non_lazy_ptr", Mang, TM);
667 MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, "$non_lazy_ptr", Mang);
701668
702669 // Add information about the stub reference to MachOMMI so that the stub
703670 // gets emitted by the asmprinter.
704671 MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(SSym);
705672 if (StubSym.getPointer() == 0) {
706 MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
673 MCSymbol *Sym = getSymbol(GV, Mang);
707674 StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
708675 }
709676
749716 return Flags;
750717 }
751718
752 const MCSection *TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(
753 const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
754 const TargetMachine &TM) const {
719 const MCSection *TargetLoweringObjectFileCOFF::
720 getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
721 Mangler &Mang, const TargetMachine &TM) const {
755722 int Selection = 0;
756723 unsigned Characteristics = getCOFFSectionFlags(Kind);
757724 StringRef Name = GV->getSection();
759726 if (GV->isWeakForLinker()) {
760727 Selection = COFF::IMAGE_COMDAT_SELECT_ANY;
761728 Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
762 MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
729 MCSymbol *Sym = getSymbol(GV, Mang);
763730 COMDATSymName = Sym->getName();
764731 }
765732 return getContext().getCOFFSection(Name,
793760 unsigned Characteristics = getCOFFSectionFlags(Kind);
794761
795762 Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
796 MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
763 MCSymbol *Sym = getSymbol(GV, Mang);
797764 return getContext().getCOFFSection(Name, Characteristics,
798765 Kind, Sym->getName(),
799766 COFF::IMAGE_COMDAT_SELECT_ANY);
2626 #include "llvm/Support/ErrorHandling.h"
2727 #include "llvm/Support/MemoryBuffer.h"
2828 #include "llvm/Support/MutexGuard.h"
29 #include "llvm/Target/TargetLowering.h"
3029
3130 using namespace llvm;
3231
371370 // load address of the symbol, not the local address.
372371 Mangler Mang(TM->getDataLayout());
373372 SmallString<128> Name;
374 TM->getTargetLowering()->getNameWithPrefix(Name, F, Mang);
373 Mang.getNameWithPrefix(Name, F);
375374 return (void*)Dyld.getSymbolLoadAddress(Name);
376375 }
377376
7575 OS << '@' << ArgWords;
7676 }
7777
78 void Mangler::getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV,
79 bool CannotUsePrivateLabel) const {
78 void Mangler::getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV) const {
8079 ManglerPrefixTy PrefixTy = Mangler::Default;
81 if (GV->hasPrivateLinkage()) {
82 if (CannotUsePrivateLabel)
83 PrefixTy = Mangler::LinkerPrivate;
84 else
85 PrefixTy = Mangler::Private;
86 } else if (GV->hasLinkerPrivateLinkage() ||
87 GV->hasLinkerPrivateWeakLinkage()) {
80 if (GV->hasPrivateLinkage())
81 PrefixTy = Mangler::Private;
82 else if (GV->hasLinkerPrivateLinkage() || GV->hasLinkerPrivateWeakLinkage())
8883 PrefixTy = Mangler::LinkerPrivate;
89 }
9084
9185 if (!GV->hasName()) {
9286 // Get the ID for the global, assigning a new one if we haven't got one
139133 }
140134
141135 void Mangler::getNameWithPrefix(SmallVectorImpl &OutName,
142 const GlobalValue *GV,
143 bool CannotUsePrivateLabel) const {
136 const GlobalValue *GV) const {
144137 raw_svector_ostream OS(OutName);
145 getNameWithPrefix(OS, GV, CannotUsePrivateLabel);
138 getNameWithPrefix(OS, GV);
146139 }
335335 SmallPtrSet &AsmUsed,
336336 Mangler &Mangler) {
337337 SmallString<64> Buffer;
338 TargetMach->getTargetLowering()->getNameWithPrefix(Buffer, &GV, Mangler);
338 Mangler.getNameWithPrefix(Buffer, &GV);
339339
340340 if (GV.isDeclaration())
341341 return;
380380
381381 // string is owned by _defines
382382 SmallString<64> Buffer;
383 _target->getTargetLowering()->getNameWithPrefix(Buffer, def, _mangler);
383 _mangler.getNameWithPrefix(Buffer, def);
384384
385385 // set alignment part log2() can have rounding errors
386386 uint32_t align = def->getAlignment();
516516 return;
517517
518518 SmallString<64> name;
519 _target->getTargetLowering()->getNameWithPrefix(name, decl, _mangler);
519 _mangler.getNameWithPrefix(name, decl);
520520
521521 StringMap::value_type &entry =
522522 _undefines.GetOrCreateValue(name);
1515 #include "llvm/MC/MCSectionELF.h"
1616 #include "llvm/Support/Dwarf.h"
1717 #include "llvm/Support/ELF.h"
18 #include "llvm/Target/TargetLowering.h"
18 #include "llvm/Target/TargetMachine.h"
1919 using namespace llvm;
2020 using namespace dwarf;
2121
4242
4343 const MCExpr *ARMElfTargetObjectFile::getTTypeGlobalReference(
4444 const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
45 const TargetMachine &TM, MachineModuleInfo *MMI,
46 MCStreamer &Streamer) const {
45 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
4746 assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only");
4847
49 return MCSymbolRefExpr::Create(TM.getTargetLowering()->getSymbol(GV, Mang),
50 MCSymbolRefExpr::VK_ARM_TARGET2, getContext());
48 return MCSymbolRefExpr::Create(getSymbol(GV, Mang),
49 MCSymbolRefExpr::VK_ARM_TARGET2,
50 getContext());
5151 }
5252
5353 const MCExpr *ARMElfTargetObjectFile::
2727
2828 void Initialize(MCContext &Ctx, const TargetMachine &TM) LLVM_OVERRIDE;
2929
30 const MCExpr *
31 getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
32 Mangler &Mang, const TargetMachine &TM,
33 MachineModuleInfo *MMI, MCStreamer &Streamer) const
30 const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
31 unsigned Encoding, Mangler &Mang,
32 MachineModuleInfo *MMI,
33 MCStreamer &Streamer) const
3434 LLVM_OVERRIDE;
3535
3636 /// \brief Describe a TLS variable address within debug info.
2424 #include "llvm/MC/MCAsmInfo.h"
2525 #include "llvm/MC/MCExpr.h"
2626 #include "llvm/MC/MCInst.h"
27 #include "llvm/Target/TargetLowering.h"
28 #include "llvm/Target/TargetLoweringObjectFile.h"
27 #include "llvm/Target/TargetMachine.h"
2928 using namespace llvm;
3029
3130 static MachineModuleInfoMachO &getMachOMMI(AsmPrinter &AP) {
3433
3534
3635 static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){
37 const TargetMachine &TM = AP.TM;
38 Mangler *Mang = AP.Mang;
39 const DataLayout *DL = TM.getDataLayout();
36 const DataLayout *DL = AP.TM.getDataLayout();
4037 MCContext &Ctx = AP.OutContext;
4138
4239 SmallString<128> Name;
5350
5451 if (!MO.isGlobal()) {
5552 assert(MO.isSymbol() && "Isn't a symbol reference");
56 Mang->getNameWithPrefix(Name, MO.getSymbolName());
53 AP.Mang->getNameWithPrefix(Name, MO.getSymbolName());
5754 } else {
5855 const GlobalValue *GV = MO.getGlobal();
59 TM.getTargetLowering()->getNameWithPrefix(Name, GV, *Mang);
56 AP.Mang->getNameWithPrefix(Name, GV);
6057 }
6158
6259 unsigned OrigLen = Name.size() - PrefixLen;
1010 #include "MCTargetDesc/SparcMCExpr.h"
1111 #include "llvm/CodeGen/MachineModuleInfoImpls.h"
1212 #include "llvm/Support/Dwarf.h"
13 #include "llvm/Target/TargetLowering.h"
1413
1514 using namespace llvm;
1615
1716 const MCExpr *SparcELFTargetObjectFile::getTTypeGlobalReference(
1817 const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
19 const TargetMachine &TM, MachineModuleInfo *MMI,
20 MCStreamer &Streamer) const {
18 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
2119
2220 if (Encoding & dwarf::DW_EH_PE_pcrel) {
2321 MachineModuleInfoELF &ELFMMI = MMI->getObjFileInfo();
2422
25 MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, ".DW.stub", Mang, TM);
23 MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, ".DW.stub", Mang);
2624
2725 // Add information about the stub reference to ELFMMI so that the stub
2826 // gets emitted by the asmprinter.
2927 MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym);
3028 if (StubSym.getPointer() == 0) {
31 MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
29 MCSymbol *Sym = getSymbol(GV, Mang);
3230 StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
3331 }
3432
3836 }
3937
4038 return TargetLoweringObjectFileELF::getTTypeGlobalReference(
41 GV, Encoding, Mang, TM, MMI, Streamer);
39 GV, Encoding, Mang, MMI, Streamer);
4240 }
2222 TargetLoweringObjectFileELF()
2323 {}
2424
25 const MCExpr *
26 getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
27 Mangler &Mang, const TargetMachine &TM,
28 MachineModuleInfo *MMI, MCStreamer &Streamer) const
25 const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
26 unsigned Encoding, Mangler &Mang,
27 MachineModuleInfo *MMI,
28 MCStreamer &Streamer) const
2929 LLVM_OVERRIDE;
3030 };
3131
2727 #include "llvm/Support/ErrorHandling.h"
2828 #include "llvm/Support/raw_ostream.h"
2929 #include "llvm/Target/TargetMachine.h"
30 #include "llvm/Target/TargetLowering.h"
3130 #include "llvm/Target/TargetOptions.h"
3231 using namespace llvm;
3332
9998 return false;
10099 }
101100
101 /// Return the MCSymbol for the specified global value. This
102 /// symbol is the main label that is the address of the global.
103 MCSymbol *TargetLoweringObjectFile::getSymbol(const GlobalValue *GV,
104 Mangler &M) const {
105 SmallString<60> NameStr;
106 M.getNameWithPrefix(NameStr, GV);
107 return Ctx->GetOrCreateSymbol(NameStr.str());
108 }
109
102110 MCSymbol *TargetLoweringObjectFile::getSymbolWithGlobalValueBase(
103 const GlobalValue *GV, StringRef Suffix, Mangler &Mang,
104 const TargetMachine &TM) const {
111 const GlobalValue *GV, StringRef Suffix, Mangler &M) const {
105112 assert(!Suffix.empty());
106113
107114 SmallString<60> NameStr;
108115 NameStr += DL->getPrivateGlobalPrefix();
109 TM.getTargetLowering()->getNameWithPrefix(NameStr, GV, Mang);
116 M.getNameWithPrefix(NameStr, GV);
110117 NameStr.append(Suffix.begin(), Suffix.end());
111118 return Ctx->GetOrCreateSymbol(NameStr.str());
112119 }
113120
114 MCSymbol *TargetLoweringObjectFile::getCFIPersonalitySymbol(
115 const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM,
116 MachineModuleInfo *MMI) const {
117 return TM.getTargetLowering()->getSymbol(GV, Mang);
121 MCSymbol *TargetLoweringObjectFile::
122 getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
123 MachineModuleInfo *MMI) const {
124 return getSymbol(GV, Mang);
118125 }
119126
120127 void TargetLoweringObjectFile::emitPersonalityValue(MCStreamer &Streamer,
267274 return SelectSectionForGlobal(GV, Kind, Mang, TM);
268275 }
269276
270 bool TargetLoweringObjectFile::isSectionAtomizableBySymbols(
271 const MCSection &Section) const {
272 return false;
273 }
274277
275278 // Lame default implementation. Calculate the section name for global.
276279 const MCSection *
308311 /// handling information.
309312 const MCExpr *TargetLoweringObjectFile::getTTypeGlobalReference(
310313 const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
311 const TargetMachine &TM, MachineModuleInfo *MMI,
312 MCStreamer &Streamer) const {
314 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
313315 const MCSymbolRefExpr *Ref =
314 MCSymbolRefExpr::Create(TM.getTargetLowering()->getSymbol(GV, Mang),
315 getContext());
316 MCSymbolRefExpr::Create(getSymbol(GV, Mang), getContext());
316317
317318 return getTTypeReference(Ref, Encoding, Streamer);
318319 }
9797
9898 if (MO.isGlobal()) {
9999 const GlobalValue *GV = MO.getGlobal();
100 AsmPrinter.getNameWithPrefix(Name, GV);
100 getMang()->getNameWithPrefix(Name, GV);
101101 } else if (MO.isSymbol()) {
102102 getMang()->getNameWithPrefix(Name, MO.getSymbolName());
103103 } else if (MO.isMBB()) {
1313 #include "llvm/MC/MCExpr.h"
1414 #include "llvm/MC/MCSectionELF.h"
1515 #include "llvm/Support/Dwarf.h"
16 #include "llvm/Target/TargetLowering.h"
1716
1817 using namespace llvm;
1918 using namespace dwarf;
2019
2120 const MCExpr *X86_64MachoTargetObjectFile::getTTypeGlobalReference(
2221 const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
23 const TargetMachine &TM, MachineModuleInfo *MMI,
24 MCStreamer &Streamer) const {
22 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
2523
2624 // On Darwin/X86-64, we can reference dwarf symbols with foo@GOTPCREL+4, which
2725 // is an indirect pc-relative reference.
2826 if (Encoding & (DW_EH_PE_indirect | DW_EH_PE_pcrel)) {
29 const MCSymbol *Sym = TM.getTargetLowering()->getSymbol(GV, Mang);
27 const MCSymbol *Sym = getSymbol(GV, Mang);
3028 const MCExpr *Res =
3129 MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOTPCREL, getContext());
3230 const MCExpr *Four = MCConstantExpr::Create(4, getContext());
3432 }
3533
3634 return TargetLoweringObjectFileMachO::getTTypeGlobalReference(
37 GV, Encoding, Mang, TM, MMI, Streamer);
35 GV, Encoding, Mang, MMI, Streamer);
3836 }
3937
40 MCSymbol *X86_64MachoTargetObjectFile::getCFIPersonalitySymbol(
41 const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM,
42 MachineModuleInfo *MMI) const {
43 return TM.getTargetLowering()->getSymbol(GV, Mang);
38 MCSymbol *X86_64MachoTargetObjectFile::
39 getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
40 MachineModuleInfo *MMI) const {
41 return getSymbol(GV, Mang);
4442 }
4543
4644 void
5553 return MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_DTPOFF, getContext());
5654 }
5755
58 const MCExpr *X86WindowsTargetObjectFile::getExecutableRelativeSymbol(
59 const ConstantExpr *CE, Mangler &Mang, const TargetMachine &TM) const {
56 const MCExpr *
57 X86WindowsTargetObjectFile::getExecutableRelativeSymbol(const ConstantExpr *CE,
58 Mangler &Mang) const {
6059 // We are looking for the difference of two symbols, need a subtraction
6160 // operation.
6261 const SubOperator *Sub = dyn_cast(CE);
101100 if (GVLHS->isThreadLocal())
102101 return 0;
103102
104 return MCSymbolRefExpr::Create(TM.getTargetLowering()->getSymbol(GVLHS, Mang),
105 MCSymbolRefExpr::VK_COFF_IMGREL32,
106 getContext());
103 return MCSymbolRefExpr::Create(
104 getSymbol(GVLHS, Mang), MCSymbolRefExpr::VK_COFF_IMGREL32, getContext());
107105 }
1919 /// x86-64.
2020 class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
2121 public:
22 const MCExpr *
23 getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
24 Mangler &Mang, const TargetMachine &TM,
25 MachineModuleInfo *MMI, MCStreamer &Streamer) const
22 const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
23 unsigned Encoding, Mangler &Mang,
24 MachineModuleInfo *MMI,
25 MCStreamer &Streamer) const
2626 LLVM_OVERRIDE;
2727
2828 // getCFIPersonalitySymbol - The symbol that gets passed to
2929 // .cfi_personality.
3030 MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
31 const TargetMachine &TM,
3231 MachineModuleInfo *MMI) const
3332 LLVM_OVERRIDE;
3433 };
4645 /// \brief This implementation is used for Windows targets on x86 and x86-64.
4746 class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF {
4847 const MCExpr *getExecutableRelativeSymbol(const ConstantExpr *CE,
49 Mangler &Mang,
50 const TargetMachine &TM) const
48 Mangler &Mang) const
5149 LLVM_OVERRIDE;
5250 };
5351
117117 return Flags;
118118 }
119119
120 const MCSection *
121 XCoreTargetObjectFile::getExplicitSectionGlobal(const GlobalValue *GV,
122 SectionKind Kind, Mangler &Mang,
123 const TargetMachine &TM) const {
120 const MCSection *XCoreTargetObjectFile::
121 getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
122 Mangler &Mang, const TargetMachine &TM) const {
124123 StringRef SectionName = GV->getSection();
125124 // Infer section flags from the section name if we can.
126125 bool IsCPRel = SectionName.startswith(".cp.");
66 ; RUN: FileCheck --check-prefix=OSX %s
77
88 ; LINUX: .Lfoo:
9 ; OSX: l_foo:
9 ; OSX: L_foo:
1010 define private void @foo() nounwind {
1111 ret void
1212 }
1313
1414 define i32 @bar() nounwind {
1515 ; LINUX: bl{{.*}}.Lfoo
16 ; OSX: bl{{.*}}l_foo
16 ; OSX: bl{{.*}}L_foo
1717 call void @foo()
1818
1919 ; LINUX: lis{{.*}}.Lbaz
20 ; OSX: lis{{.*}}l_baz
20 ; OSX: lis{{.*}}L_baz
2121 %1 = load i32* @baz, align 4
2222 ret i32 %1
2323 }
2424
2525 ; LINUX: .Lbaz:
26 ; OSX: l_baz:
26 ; OSX: L_baz:
2727 @baz = private global i32 4
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 | FileCheck %s
11 ; rdar://7396984
22
3 @str = private unnamed_addr constant [28 x i8] c"xxxxxxxxxxxxxxxxxxxxxxxxxxx\00", align 1
3 @str = private constant [28 x i8] c"xxxxxxxxxxxxxxxxxxxxxxxxxxx\00", align 1
44
55 define void @t(i32 %count) ssp nounwind {
66 entry:
167167 ; DARWIN: .zerofill __DATA,__common,_G12,1,3
168168 ; DARWIN: .globl _G13
169169 ; DARWIN: .zerofill __DATA,__common,_G13,1,3
170
171 @G14 = private unnamed_addr constant [4 x i8] c"foo\00", align 1
172
173 ; LINUX-SECTIONS: .type .LG14,@object # @G14
174 ; LINUX-SECTIONS: .section .rodata..LG14,"aMS",@progbits,1
175 ; LINUX-SECTIONS: .LG14:
176 ; LINUX-SECTIONS: .asciz "foo"
177 ; LINUX-SECTIONS: .size .LG14, 4
+0
-71
test/CodeGen/X86/osx-private-labels.ll less more
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
1 ; Test all the cases where a L label is safe. Removing any entry from
2 ; TargetLoweringObjectFileMachO::isSectionAtomizableBySymbols should cause
3 ; this to fail.
4 ; We also test some noteworthy cases that require an l label.
5
6 @private1 = private unnamed_addr constant [4 x i8] c"zed\00"
7 ; CHECK: .section __TEXT,__cstring,cstring_literals
8 ; CHECK-NEXT: L_private1:
9
10 @private2 = private unnamed_addr constant [5 x i16] [i16 116, i16 101,
11 i16 115, i16 116, i16 0]
12 ; CHECK: .section __TEXT,__ustring
13 ; CHECK-NEXT: .align 1
14 ; CHECK-NEXT: l_private2:
15
16 ; There is no dedicated 4 byte strings on MachO.
17
18 %struct.NSConstantString = type { i32*, i32, i8*, i32 }
19 @private3 = private constant %struct.NSConstantString { i32* null, i32 1992, i8* null, i32 0 }, section "__DATA,__cfstring"
20 ; CHECK: .section __DATA,__cfstring
21 ; CHECK-NEXT: .align 4
22 ; CHECK-NEXT: L_private3:
23
24 ; There is no dedicated 1 or 2 byte constant section on MachO.
25
26 @private4 = private unnamed_addr constant i32 42
27 ; CHECK: .section __TEXT,__literal4,4byte_literals
28 ; CHECK-NEXT: .align 2
29 ; CHECK-NEXT: L_private4:
30
31 @private5 = private unnamed_addr constant i64 42
32 ; CHECK: .section __TEXT,__literal8,8byte_literals
33 ; CHECK-NEXT: .align 3
34 ; CHECK-NEXT: L_private5:
35
36 @private6 = private unnamed_addr constant i128 42
37 ; CHECK: .section __TEXT,__literal16,16byte_literals
38 ; CHECK-NEXT: .align 3
39 ; CHECK-NEXT: L_private6:
40
41 %struct._objc_class = type { i8* }
42 @private7 = private global %struct._objc_class* null, section "__OBJC,__cls_refs,literal_pointers,no_dead_strip"
43 ; CHECK: .section __OBJC,__cls_refs,literal_pointers,no_dead_strip
44 ; CHECK: .align 3
45 ; CHECK: L_private7:
46
47 @private8 = private global i32* null, section "__DATA,__nl_symbol_ptr,non_lazy_symbol_pointers"
48 ; CHECK: .section __DATA,__nl_symbol_ptr,non_lazy_symbol_pointers
49 ; CHECK-NEXT: .align 3
50 ; CHECK-NEXT: L_private8:
51
52 @private9 = private global i32* null, section "__DATA,__la_symbol_ptr,lazy_symbol_pointers"
53 ; CHECK: .section __DATA,__la_symbol_ptr,lazy_symbol_pointers
54 ; CHECK-NEXT: .align 3
55 ; CHECK-NEXT: L_private9:
56
57 @private10 = private global i32* null, section "__DATA,__mod_init_func,mod_init_funcs"
58 ; CHECK: .section __DATA,__mod_init_func,mod_init_funcs
59 ; CHECK-NEXT: .align 3
60 ; CHECK-NEXT: L_private10:
61
62 @private11 = private global i32* null, section "__DATA,__mod_term_func,mod_term_funcs"
63 ; CHECK: .section __DATA,__mod_term_func,mod_term_funcs
64 ; CHECK-NEXT: .align 3
65 ; CHECK-NEXT: L_private11:
66
67 @private12 = private global i32* null, section "__DATA,__foobar,interposing"
68 ; CHECK: .section __DATA,__foobar,interposing
69 ; CHECK-NEXT: .align 3
70 ; CHECK-NEXT: L_private12:
1313 ret void;
1414 }
1515
16 ; CHECK: l_foo: ## @foo
16 ; CHECK: L_foo: ## @foo
1717 ; CHECK-NEXT: Ltmp0:
1818
1919 ; CHECK: _bar: ## @bar
3333 ; CHECK-NEXT: {{.quad|.long}} Ltmp[[NUM2]]
3434
3535
36 ; OLD: l_foo: ## @foo
36 ; OLD: L_foo: ## @foo
3737 ; OLD-NEXT: Ltmp0:
3838
3939 ; OLD: _bar: ## @bar
11 ; Quote should be outside of private prefix.
22 ; rdar://6855766x
33
4 ; CHECK: "l__ZZ20-[Example1 whatever]E4C.91"
4 ; CHECK: L__ZZ20
55
66 %struct.A = type { i32*, i32 }
77 @"_ZZ20-[Example1 whatever]E4C.91" = private constant %struct.A { i32* null, i32 1 } ; <%struct.A*> [#uses=1]