const MCSection *getSectionForConstant(SectionKind Kind) const LLVM_OVERRIDE;
const MCSection *getExplicitSectionGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
/// Return an MCExpr to use for a reference to the specified type info global
/// variable from exception handling information.
- const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+ const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI,
unsigned Encoding,
MCStreamer &Streamer) const
LLVM_OVERRIDE;
// The symbol that gets passed to .cfi_personality.
- MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
+ MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI) const LLVM_OVERRIDE;
void InitializeELF(bool UseInitArray_);
/// Emit the module flags that specify the garbage collection information.
void emitModuleFlags(MCStreamer &Streamer,
ArrayRef<Module::ModuleFlagEntry> ModuleFlags,
- Mangler *Mang, const TargetMachine &TM) const
+ Mangler &Mang, const TargetMachine &TM) const
LLVM_OVERRIDE;
const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
const MCSection *getExplicitSectionGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
/// This hook allows targets to selectively decide not to emit the
/// UsedDirective for some symbols in llvm.used.
/// FIXME: REMOVE this (rdar://7071300)
- bool shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler *Mang) const
+ bool shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler &Mang) const
LLVM_OVERRIDE;
/// The mach-o version of this method defaults to returning a stub reference.
- const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+ const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI,
unsigned Encoding,
MCStreamer &Streamer) const
LLVM_OVERRIDE;
// The symbol that gets passed to .cfi_personality.
- MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
+ MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI) const LLVM_OVERRIDE;
};
virtual ~TargetLoweringObjectFileCOFF() {}
const MCSection *getExplicitSectionGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
/// emission is implemented for COFF.
void emitModuleFlags(MCStreamer &Streamer,
ArrayRef<Module::ModuleFlagEntry> ModuleFlags,
- Mangler *Mang, const TargetMachine &TM) const
+ Mangler &Mang, const TargetMachine &TM) const
LLVM_OVERRIDE;
};
}
/// Emit the module flags that the platform cares about.
- virtual void emitModuleFlags(MCStreamer &,
- ArrayRef<Module::ModuleFlagEntry>,
- Mangler *, const TargetMachine &) const {
- }
+ virtual void emitModuleFlags(MCStreamer &Streamer,
+ ArrayRef<Module::ModuleFlagEntry> Flags,
+ Mangler &Mang, const TargetMachine &TM) const {}
/// This hook allows targets to selectively decide not to emit the
/// UsedDirective for some symbols in llvm.used.
/// FIXME: REMOVE this (rdar://7071300)
virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
- Mangler *) const {
+ Mangler &Mang) const {
return GV != 0;
}
/// variable or function definition. This should not be passed external (or
/// available externally) globals.
const MCSection *SectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const;
/// This method computes the appropriate section to emit the specified global
/// variable or function definition. This should not be passed external (or
/// available externally) globals.
const MCSection *SectionForGlobal(const GlobalValue *GV,
- Mangler *Mang,
+ Mangler &Mang,
const TargetMachine &TM) const {
return SectionForGlobal(GV, getKindForGlobal(GV, TM), Mang, TM);
}
/// assume that GV->hasSection() is true.
virtual const MCSection *
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const = 0;
+ Mangler &Mang, const TargetMachine &TM) const = 0;
/// Allow the target to completely override section assignment of a global.
virtual const MCSection *
- getSpecialCasedSectionGlobals(const GlobalValue *GV, Mangler *Mang,
+ getSpecialCasedSectionGlobals(const GlobalValue *GV, Mangler &Mang,
SectionKind Kind) const {
return 0;
}
/// Return an MCExpr to use for a reference to the specified global variable
/// from exception handling information.
virtual const MCExpr *
- getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+ getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI, unsigned Encoding,
MCStreamer &Streamer) const;
// The symbol that gets passed to .cfi_personality.
virtual MCSymbol *
- getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
+ getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI) const;
const MCExpr *
virtual const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const;
virtual const MCExpr *
- getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler *Mang) const {
+ getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang) const {
return 0;
}
protected:
virtual const MCSection *
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const;
+ Mangler &Mang, const TargetMachine &TM) const;
};
} // end namespace llvm
// Handle local BSS symbols.
if (MAI->hasMachoZeroFillDirective()) {
const MCSection *TheSection =
- getObjFileLowering().SectionForGlobal(GV, GVKind, Mang, TM);
+ getObjFileLowering().SectionForGlobal(GV, GVKind, *Mang, TM);
// .zerofill __DATA, __bss, _foo, 400, 5
OutStreamer.EmitZerofill(TheSection, GVSym, Size, Align);
return;
}
const MCSection *TheSection =
- getObjFileLowering().SectionForGlobal(GV, GVKind, Mang, TM);
+ getObjFileLowering().SectionForGlobal(GV, GVKind, *Mang, TM);
// Handle the zerofill directive on darwin, which is a special form of BSS
// emission.
// Print the 'header' of function.
const Function *F = MF->getFunction();
- OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F, Mang, TM));
+ OutStreamer.SwitchSection(
+ getObjFileLowering().SectionForGlobal(F, *Mang, TM));
EmitVisibility(CurrentFnSym, F->getVisibility());
EmitLinkage(F, CurrentFnSym);
SmallVector<Module::ModuleFlagEntry, 8> ModuleFlags;
M.getModuleFlagsMetadata(ModuleFlags);
if (!ModuleFlags.empty())
- getObjFileLowering().emitModuleFlags(OutStreamer, ModuleFlags, Mang, TM);
+ getObjFileLowering().emitModuleFlags(OutStreamer, ModuleFlags, *Mang, TM);
// Make sure we wrote out everything we need.
OutStreamer.Flush();
// FIXME: this isn't the right predicate, should be based on the MCSection
// for the function.
F->isWeakForLinker()) {
- OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(F,Mang,TM));
+ OutStreamer.SwitchSection(
+ getObjFileLowering().SectionForGlobal(F, *Mang, TM));
} else {
// Otherwise, drop it in the readonly section.
const MCSection *ReadOnlySection =
for (unsigned i = 0, e = InitList->getNumOperands(); i != e; ++i) {
const GlobalValue *GV =
dyn_cast<GlobalValue>(InitList->getOperand(i)->stripPointerCasts());
- if (GV && getObjFileLowering().shouldEmitUsedDirectiveFor(GV, Mang))
+ if (GV && getObjFileLowering().shouldEmitUsedDirectiveFor(GV, *Mang))
OutStreamer.EmitSymbolAttribute(getSymbol(GV), MCSA_NoDeadStrip);
}
}
}
if (const MCExpr *RelocExpr =
- AP.getObjFileLowering().getExecutableRelativeSymbol(CE, AP.Mang))
+ AP.getObjFileLowering().getExecutableRelativeSymbol(CE, *AP.Mang))
return RelocExpr;
switch (CE->getOpcode()) {
const TargetLoweringObjectFile &TLOF = getObjFileLowering();
const MCExpr *Exp =
- TLOF.getTTypeGlobalReference(GV, Mang, MMI, Encoding, OutStreamer);
+ TLOF.getTTypeGlobalReference(GV, *Mang, MMI, Encoding, OutStreamer);
OutStreamer.EmitValue(Exp, GetSizeOfEncodedValue(Encoding));
} else
OutStreamer.EmitIntValue(0, GetSizeOfEncodedValue(Encoding));
if (!shouldEmitPersonality)
return;
- const MCSymbol *Sym = TLOF.getCFIPersonalitySymbol(Per, Asm->Mang, MMI);
+ const MCSymbol *Sym = TLOF.getCFIPersonalitySymbol(Per, *Asm->Mang, MMI);
Asm->OutStreamer.EmitCFIPersonality(Sym, PerEncoding);
Asm->OutStreamer.EmitDebugLabel
if (shouldEmitPersonality) {
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
- const MCSymbol *Sym = TLOF.getCFIPersonalitySymbol(Per, Asm->Mang, MMI);
+ const MCSymbol *Sym = TLOF.getCFIPersonalitySymbol(Per, *Asm->Mang, MMI);
Asm->OutStreamer.PushSection();
Asm->OutStreamer.EmitWin64EHHandlerData();
MCSymbol *
TargetLoweringObjectFileELF::getCFIPersonalitySymbol(const GlobalValue *GV,
- Mangler *Mang,
+ Mangler &Mang,
MachineModuleInfo *MMI) const {
unsigned Encoding = getPersonalityEncoding();
switch (Encoding & 0x70) {
default:
report_fatal_error("We do not support this DWARF encoding yet!");
case dwarf::DW_EH_PE_absptr:
- return getSymbol(*Mang, GV);
+ return getSymbol(Mang, GV);
case dwarf::DW_EH_PE_pcrel: {
return getContext().GetOrCreateSymbol(StringRef("DW.ref.") +
- getSymbol(*Mang, GV)->getName());
+ getSymbol(Mang, GV)->getName());
}
}
}
}
const MCExpr *TargetLoweringObjectFileELF::
-getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI, unsigned Encoding,
MCStreamer &Streamer) const {
if (Encoding & dwarf::DW_EH_PE_indirect) {
MachineModuleInfoELF &ELFMMI = MMI->getObjFileInfo<MachineModuleInfoELF>();
- MCSymbol *SSym = getSymbolWithGlobalValueBase(*Mang, GV, ".DW.stub");
+ MCSymbol *SSym = getSymbolWithGlobalValueBase(Mang, GV, ".DW.stub");
// Add information about the stub reference to ELFMMI so that the stub
// gets emitted by the asmprinter.
MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym);
if (StubSym.getPointer() == 0) {
- MCSymbol *Sym = getSymbol(*Mang, GV);
+ MCSymbol *Sym = getSymbol(Mang, GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
const MCSection *TargetLoweringObjectFileELF::
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
StringRef SectionName = GV->getSection();
// Infer section flags from the section name if we can.
const MCSection *TargetLoweringObjectFileELF::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
// If we have -ffunction-section or -fdata-section then we should emit the
// global value to a uniqued section specifically for it.
bool EmitUniquedSection;
Prefix = getSectionPrefixForGlobal(Kind);
SmallString<128> Name(Prefix, Prefix+strlen(Prefix));
- MCSymbol *Sym = getSymbol(*Mang, GV);
+ MCSymbol *Sym = getSymbol(Mang, GV);
Name.append(Sym->getName().begin(), Sym->getName().end());
StringRef Group = "";
unsigned Flags = getELFSectionFlags(Kind);
void TargetLoweringObjectFileMachO::
emitModuleFlags(MCStreamer &Streamer,
ArrayRef<Module::ModuleFlagEntry> ModuleFlags,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
unsigned VersionVal = 0;
unsigned ImageInfoFlags = 0;
MDNode *LinkerOptions = 0;
const MCSection *TargetLoweringObjectFileMachO::
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
// Parse the section specifier and create it if valid.
StringRef Segment, Section;
unsigned TAA = 0, StubSize = 0;
const MCSection *TargetLoweringObjectFileMachO::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
// Handle thread local data.
if (Kind.isThreadBSS()) return TLSBSSSection;
/// not to emit the UsedDirective for some symbols in llvm.used.
// FIXME: REMOVE this (rdar://7071300)
bool TargetLoweringObjectFileMachO::
-shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler *Mang) const {
+shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler &Mang) const {
/// On Darwin, internally linked data beginning with "L" or "l" does not have
/// the directive emitted (this occurs in ObjC metadata).
if (!GV) return false;
// FIXME: ObjC metadata is currently emitted as internal symbols that have
// \1L and \0l prefixes on them. Fix them to be Private/LinkerPrivate and
// this horrible hack can go away.
- MCSymbol *Sym = getSymbol(*Mang, GV);
+ MCSymbol *Sym = getSymbol(Mang, GV);
if (Sym->getName()[0] == 'L' || Sym->getName()[0] == 'l')
return false;
}
}
const MCExpr *TargetLoweringObjectFileMachO::
-getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI, unsigned Encoding,
MCStreamer &Streamer) const {
// The mach-o version of this method defaults to returning a stub reference.
MachineModuleInfoMachO &MachOMMI =
MMI->getObjFileInfo<MachineModuleInfoMachO>();
- MCSymbol *SSym = getSymbolWithGlobalValueBase(*Mang, GV, "$non_lazy_ptr");
+ MCSymbol *SSym = getSymbolWithGlobalValueBase(Mang, GV, "$non_lazy_ptr");
// Add information about the stub reference to MachOMMI so that the stub
// gets emitted by the asmprinter.
GV->hasHiddenVisibility() ? MachOMMI.getHiddenGVStubEntry(SSym) :
MachOMMI.getGVStubEntry(SSym);
if (StubSym.getPointer() == 0) {
- MCSymbol *Sym = getSymbol(*Mang, GV);
+ MCSymbol *Sym = getSymbol(Mang, GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
}
MCSymbol *TargetLoweringObjectFileMachO::
-getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
+getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI) const {
// The mach-o version of this method defaults to returning a stub reference.
MachineModuleInfoMachO &MachOMMI =
MMI->getObjFileInfo<MachineModuleInfoMachO>();
- MCSymbol *SSym = getSymbolWithGlobalValueBase(*Mang, GV, "$non_lazy_ptr");
+ MCSymbol *SSym = getSymbolWithGlobalValueBase(Mang, GV, "$non_lazy_ptr");
// Add information about the stub reference to MachOMMI so that the stub
// gets emitted by the asmprinter.
MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(SSym);
if (StubSym.getPointer() == 0) {
- MCSymbol *Sym = getSymbol(*Mang, GV);
+ MCSymbol *Sym = getSymbol(Mang, GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
const MCSection *TargetLoweringObjectFileCOFF::
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
int Selection = 0;
unsigned Characteristics = getCOFFSectionFlags(Kind);
StringRef Name = GV->getSection();
if (GV->isWeakForLinker()) {
Selection = COFF::IMAGE_COMDAT_SELECT_ANY;
Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
- MCSymbol *Sym = getSymbol(*Mang, GV);
+ MCSymbol *Sym = getSymbol(Mang, GV);
COMDATSymName = Sym->getName();
}
return getContext().getCOFFSection(Name,
const MCSection *TargetLoweringObjectFileCOFF::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
// If this global is linkonce/weak and the target handles this by emitting it
// into a 'uniqued' section name, create and return the section now.
unsigned Characteristics = getCOFFSectionFlags(Kind);
Characteristics |= COFF::IMAGE_SCN_LNK_COMDAT;
- MCSymbol *Sym = getSymbol(*Mang, GV);
+ MCSymbol *Sym = getSymbol(Mang, GV);
return getContext().getCOFFSection(Name, Characteristics,
Kind, Sym->getName(),
COFF::IMAGE_COMDAT_SELECT_ANY);
void TargetLoweringObjectFileCOFF::
emitModuleFlags(MCStreamer &Streamer,
ArrayRef<Module::ModuleFlagEntry> ModuleFlags,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
MDNode *LinkerOptions = 0;
// Look for the "Linker Options" flag, since it's the only one we support.
// Now any user defined text sections from function attributes.
for (Module::iterator F = M.begin(), e = M.end(); F != e; ++F)
if (!F->isDeclaration() && !F->hasAvailableExternallyLinkage())
- TextSections.insert(TLOFMacho.SectionForGlobal(F, Mang, TM));
+ TextSections.insert(TLOFMacho.SectionForGlobal(F, *Mang, TM));
// Now the coalescable sections.
TextSections.insert(TLOFMacho.getTextCoalSection());
TextSections.insert(TLOFMacho.getConstTextCoalSection());
}
const MCExpr *ARMElfTargetObjectFile::
-getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI, unsigned Encoding,
MCStreamer &Streamer) const {
assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only");
- return MCSymbolRefExpr::Create(getSymbol(*Mang, GV),
+ return MCSymbolRefExpr::Create(getSymbol(Mang, GV),
MCSymbolRefExpr::VK_ARM_TARGET2,
getContext());
}
void Initialize(MCContext &Ctx, const TargetMachine &TM) LLVM_OVERRIDE;
- const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+ const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI,
unsigned Encoding,
MCStreamer &Streamer) const
return false;
}
-const MCSection *HexagonTargetObjectFile::
-SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+const MCSection *
+HexagonTargetObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
+ SectionKind Kind, Mangler &Mang,
+ const TargetMachine &TM) const {
// Handle Small Section classification here.
if (Kind.isBSS() && IsGlobalInSmallSection(GV, TM, Kind))
bool IsSmallDataEnabled () const;
const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
};
const MCSection *MipsTargetObjectFile::
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
// TODO: Could also support "weak" symbols as well with ".gnu.linkonce.s.*"
// sections?
const TargetMachine &TM) const;
const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
};
}
const MCSection *getExplicitSectionGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE {
return DataSection;
InitializeELF(TM.Options.UseInitArray);
}
-const MCSection * PPC64LinuxTargetObjectFile::
-SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+const MCSection *PPC64LinuxTargetObjectFile::SelectSectionForGlobal(
+ const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
+ const TargetMachine &TM) const {
const MCSection *DefaultSection =
TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM);
void Initialize(MCContext &Ctx, const TargetMachine &TM) LLVM_OVERRIDE;
const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
const MCExpr *SparcELFTargetObjectFile::
-getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI, unsigned Encoding,
MCStreamer &Streamer) const {
if (Encoding & dwarf::DW_EH_PE_pcrel) {
MachineModuleInfoELF &ELFMMI = MMI->getObjFileInfo<MachineModuleInfoELF>();
- MCSymbol *SSym = getSymbolWithGlobalValueBase(*Mang, GV, ".DW.stub");
+ MCSymbol *SSym = getSymbolWithGlobalValueBase(Mang, GV, ".DW.stub");
// Add information about the stub reference to ELFMMI so that the stub
// gets emitted by the asmprinter.
MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym);
if (StubSym.getPointer() == 0) {
- MCSymbol *Sym = getSymbol(*Mang, GV);
+ MCSymbol *Sym = getSymbol(Mang, GV);
StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage());
}
TargetLoweringObjectFileELF()
{}
- const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+ const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI,
unsigned Encoding,
MCStreamer &Streamer) const
}
MCSymbol *TargetLoweringObjectFile::
-getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
+getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI) const {
- return getSymbol(*Mang, GV);
+ return getSymbol(Mang, GV);
}
void TargetLoweringObjectFile::emitPersonalityValue(MCStreamer &Streamer,
/// the specified global variable or function definition. This should not
/// be passed external (or available externally) globals.
const MCSection *TargetLoweringObjectFile::
-SectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang,
+SectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const {
// Select section name.
if (GV->hasSection())
const MCSection *
TargetLoweringObjectFile::SelectSectionForGlobal(const GlobalValue *GV,
SectionKind Kind,
- Mangler *Mang,
+ Mangler &Mang,
const TargetMachine &TM) const{
assert(!Kind.isThreadLocal() && "Doesn't support TLS");
/// reference to the specified global variable from exception
/// handling information.
const MCExpr *TargetLoweringObjectFile::
-getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI, unsigned Encoding,
MCStreamer &Streamer) const {
const MCSymbolRefExpr *Ref =
- MCSymbolRefExpr::Create(getSymbol(*Mang, GV), getContext());
+ MCSymbolRefExpr::Create(getSymbol(Mang, GV), getContext());
return getTTypeReference(Ref, Encoding, Streamer);
}
using namespace dwarf;
const MCExpr *X86_64MachoTargetObjectFile::
-getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI, unsigned Encoding,
MCStreamer &Streamer) const {
// On Darwin/X86-64, we can reference dwarf symbols with foo@GOTPCREL+4, which
// is an indirect pc-relative reference.
if (Encoding & (DW_EH_PE_indirect | DW_EH_PE_pcrel)) {
- const MCSymbol *Sym = getSymbol(*Mang, GV);
+ const MCSymbol *Sym = getSymbol(Mang, GV);
const MCExpr *Res =
MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOTPCREL, getContext());
const MCExpr *Four = MCConstantExpr::Create(4, getContext());
}
MCSymbol *X86_64MachoTargetObjectFile::
-getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
+getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI) const {
- return getSymbol(*Mang, GV);
+ return getSymbol(Mang, GV);
}
void
const MCExpr *
X86WindowsTargetObjectFile::getExecutableRelativeSymbol(const ConstantExpr *CE,
- Mangler *Mang) const {
+ Mangler &Mang) const {
// We are looking for the difference of two symbols, need a subtraction
// operation.
const SubOperator *Sub = dyn_cast<SubOperator>(CE);
return 0;
return MCSymbolRefExpr::Create(
- getSymbol(*Mang, GVLHS), MCSymbolRefExpr::VK_COFF_IMGREL32, getContext());
+ getSymbol(Mang, GVLHS), MCSymbolRefExpr::VK_COFF_IMGREL32, getContext());
}
/// x86-64.
class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
public:
- const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
+ const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI,
unsigned Encoding,
MCStreamer &Streamer) const
// getCFIPersonalitySymbol - The symbol that gets passed to
// .cfi_personality.
- MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
+ MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
MachineModuleInfo *MMI) const
LLVM_OVERRIDE;
};
/// \brief This implementation is used for Windows targets on x86 and x86-64.
class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF {
const MCExpr *getExecutableRelativeSymbol(const ConstantExpr *CE,
- Mangler *Mang) const
+ Mangler &Mang) const
LLVM_OVERRIDE;
};
return;
const DataLayout *TD = TM.getDataLayout();
- OutStreamer.SwitchSection(getObjFileLowering().SectionForGlobal(GV, Mang,TM));
+ OutStreamer.SwitchSection(
+ getObjFileLowering().SectionForGlobal(GV, *Mang, TM));
-
MCSymbol *GVSym = getSymbol(GV);
const Constant *C = GV->getInitializer();
unsigned Align = (unsigned)TD->getPreferredTypeAlignmentShift(C->getType());
const MCSection *XCoreTargetObjectFile::
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
- Mangler *Mang, const TargetMachine &TM) const {
+ Mangler &Mang, const TargetMachine &TM) const {
StringRef SectionName = GV->getSection();
// Infer section flags from the section name if we can.
Kind = getXCoreKindForNamedSection(SectionName, Kind);
}
const MCSection *XCoreTargetObjectFile::
-SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang,
+SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const{
if (Kind.isText()) return TextSection;
if (Kind.isMergeable1ByteCString()) return CStringSection;
void Initialize(MCContext &Ctx, const TargetMachine &TM);
const MCSection *getExplicitSectionGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;
const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
- SectionKind Kind, Mangler *Mang,
+ SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const
LLVM_OVERRIDE;