From 31a9212b0b7f8ddd58ab939ad9f169df1a5f5c6a Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sun, 21 Feb 2010 20:28:15 +0000 Subject: It turned out that we failed to emit proper symbol stubs on non-x86/darwin for ages (we emitted a reference to a stub, but no stub was emitted). The code inside x86-32/macho target objfile lowering should actually be the generic one - move it there. This (I really, really hope) should fix EH issues on ppc/darwin and arm/darwin. llvm-svn: 96755 --- llvm/lib/Target/X86/X86TargetObjectFile.cpp | 64 ----------------------------- 1 file changed, 64 deletions(-) (limited to 'llvm/lib/Target/X86/X86TargetObjectFile.cpp') diff --git a/llvm/lib/Target/X86/X86TargetObjectFile.cpp b/llvm/lib/Target/X86/X86TargetObjectFile.cpp index 11046461130..29a0be53f21 100644 --- a/llvm/lib/Target/X86/X86TargetObjectFile.cpp +++ b/llvm/lib/Target/X86/X86TargetObjectFile.cpp @@ -18,38 +18,6 @@ using namespace llvm; using namespace dwarf; -const MCExpr *X8632_MachoTargetObjectFile:: -getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, - MachineModuleInfo *MMI, unsigned Encoding) const { - // The mach-o version of this method defaults to returning a stub reference. - - if (Encoding & DW_EH_PE_indirect) { - MachineModuleInfoMachO &MachOMMI = - MMI->getObjFileInfo(); - - SmallString<128> Name; - Mang->getNameWithPrefix(Name, GV, true); - Name += "$non_lazy_ptr"; - - // Add information about the stub reference to MachOMMI so that the stub - // gets emitted by the asmprinter. - MCSymbol *Sym = getContext().GetOrCreateSymbol(Name.str()); - MCSymbol *&StubSym = MachOMMI.getGVStubEntry(Sym); - if (StubSym == 0) { - Name.clear(); - Mang->getNameWithPrefix(Name, GV, false); - StubSym = getContext().GetOrCreateSymbol(Name.str()); - } - - return TargetLoweringObjectFile:: - getSymbolForDwarfReference(Sym, MMI, - Encoding & ~dwarf::DW_EH_PE_indirect); - } - - return TargetLoweringObjectFileMachO:: - getSymbolForDwarfGlobalReference(GV, Mang, MMI, Encoding); -} - const MCExpr *X8664_MachoTargetObjectFile:: getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang, MachineModuleInfo *MMI, unsigned Encoding) const { @@ -148,35 +116,3 @@ unsigned X8664_ELFTargetObjectFile::getTTypeEncoding() const { return DW_EH_PE_absptr; } - -unsigned X8632_MachoTargetObjectFile::getPersonalityEncoding() const { - return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4; -} - -unsigned X8632_MachoTargetObjectFile::getLSDAEncoding() const { - return DW_EH_PE_pcrel; -} - -unsigned X8632_MachoTargetObjectFile::getFDEEncoding() const { - return DW_EH_PE_pcrel; -} - -unsigned X8632_MachoTargetObjectFile::getTTypeEncoding() const { - return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4; -} - -unsigned X8664_MachoTargetObjectFile::getPersonalityEncoding() const { - return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4; -} - -unsigned X8664_MachoTargetObjectFile::getLSDAEncoding() const { - return DW_EH_PE_pcrel; -} - -unsigned X8664_MachoTargetObjectFile::getFDEEncoding() const { - return DW_EH_PE_pcrel; -} - -unsigned X8664_MachoTargetObjectFile::getTTypeEncoding() const { - return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4; -} -- cgit v1.2.3