mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-09 01:38:03 +00:00
rename getSymbolForDwarf* to getExprForDwarf* since it returns
an MCExpr and not an MCSymbol. Change it to take an MCStreamer, which is currently unused. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98278 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
af1871fa6d
commit
3192d14076
@ -78,12 +78,13 @@ public:
|
||||
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
||||
Mangler *Mang, const TargetMachine &TM) const;
|
||||
|
||||
/// getSymbolForDwarfGlobalReference - Return an MCExpr to use for a reference
|
||||
/// getExprForDwarfGlobalReference - Return an MCExpr to use for a reference
|
||||
/// to the specified global variable from exception handling information.
|
||||
///
|
||||
virtual const MCExpr *
|
||||
getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding) const;
|
||||
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding,
|
||||
MCStreamer &Streamer) const;
|
||||
};
|
||||
|
||||
|
||||
@ -166,11 +167,12 @@ public:
|
||||
return NonLazySymbolPointerSection;
|
||||
}
|
||||
|
||||
/// getSymbolForDwarfGlobalReference - The mach-o version of this method
|
||||
/// getExprForDwarfGlobalReference - The mach-o version of this method
|
||||
/// defaults to returning a stub reference.
|
||||
virtual const MCExpr *
|
||||
getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding) const;
|
||||
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding,
|
||||
MCStreamer &Streamer) const;
|
||||
|
||||
virtual unsigned getPersonalityEncoding() const;
|
||||
virtual unsigned getLSDAEncoding() const;
|
||||
|
@ -22,11 +22,12 @@ namespace llvm {
|
||||
class MachineModuleInfo;
|
||||
class Mangler;
|
||||
class MCAsmInfo;
|
||||
class MCContext;
|
||||
class MCExpr;
|
||||
class MCSection;
|
||||
class MCSectionMachO;
|
||||
class MCSymbol;
|
||||
class MCContext;
|
||||
class MCStreamer;
|
||||
class GlobalValue;
|
||||
class TargetMachine;
|
||||
|
||||
@ -197,17 +198,20 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// getSymbolForDwarfGlobalReference - Return an MCExpr to use for a reference
|
||||
/// getExprForDwarfGlobalReference - Return an MCExpr to use for a reference
|
||||
/// to the specified global variable from exception handling information.
|
||||
///
|
||||
virtual const MCExpr *
|
||||
getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding) const;
|
||||
|
||||
virtual const MCExpr *
|
||||
getSymbolForDwarfReference(const MCSymbol *Sym, MachineModuleInfo *MMI,
|
||||
unsigned Encoding) const;
|
||||
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding,
|
||||
MCStreamer &Streamer) const;
|
||||
|
||||
///
|
||||
const MCExpr *
|
||||
getExprForDwarfReference(const MCSymbol *Sym, MachineModuleInfo *MMI,
|
||||
unsigned Encoding,
|
||||
MCStreamer &Streamer) const;
|
||||
|
||||
virtual unsigned getPersonalityEncoding() const;
|
||||
virtual unsigned getLSDAEncoding() const;
|
||||
virtual unsigned getFDEEncoding() const;
|
||||
|
@ -189,7 +189,8 @@ void DwarfPrinter::EmitULEB128(unsigned Value, const char *Desc,
|
||||
void DwarfPrinter::EmitReference(const MCSymbol *Sym, unsigned Encoding) const {
|
||||
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
||||
|
||||
const MCExpr *Exp = TLOF.getSymbolForDwarfReference(Sym, Asm->MMI, Encoding);
|
||||
const MCExpr *Exp = TLOF.getExprForDwarfReference(Sym, Asm->MMI, Encoding,
|
||||
Asm->OutStreamer);
|
||||
Asm->OutStreamer.EmitValue(Exp, SizeOfEncodedValue(Encoding), /*addrspace*/0);
|
||||
}
|
||||
|
||||
@ -197,7 +198,8 @@ void DwarfPrinter::EmitReference(const GlobalValue *GV, unsigned Encoding)const{
|
||||
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
||||
|
||||
const MCExpr *Exp =
|
||||
TLOF.getSymbolForDwarfGlobalReference(GV, Asm->Mang, Asm->MMI, Encoding);
|
||||
TLOF.getExprForDwarfGlobalReference(GV, Asm->Mang, Asm->MMI, Encoding,
|
||||
Asm->OutStreamer);
|
||||
Asm->OutStreamer.EmitValue(Exp, SizeOfEncodedValue(Encoding), /*addrspace*/0);
|
||||
}
|
||||
|
||||
|
@ -391,8 +391,9 @@ getSectionForConstant(SectionKind Kind) const {
|
||||
}
|
||||
|
||||
const MCExpr *TargetLoweringObjectFileELF::
|
||||
getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding) const {
|
||||
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI,
|
||||
unsigned Encoding, MCStreamer &Streamer) const {
|
||||
|
||||
if (Encoding & dwarf::DW_EH_PE_indirect) {
|
||||
MachineModuleInfoELF &ELFMMI = MMI->getObjFileInfo<MachineModuleInfoELF>();
|
||||
@ -420,12 +421,12 @@ getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
}
|
||||
|
||||
return TargetLoweringObjectFile::
|
||||
getSymbolForDwarfReference(Sym, MMI,
|
||||
Encoding & ~dwarf::DW_EH_PE_indirect);
|
||||
getExprForDwarfReference(Sym, MMI,
|
||||
Encoding & ~dwarf::DW_EH_PE_indirect, Streamer);
|
||||
}
|
||||
|
||||
return TargetLoweringObjectFile::
|
||||
getSymbolForDwarfGlobalReference(GV, Mang, MMI, Encoding);
|
||||
getExprForDwarfGlobalReference(GV, Mang, MMI, Encoding, Streamer);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -751,8 +752,9 @@ shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler *Mang) const {
|
||||
}
|
||||
|
||||
const MCExpr *TargetLoweringObjectFileMachO::
|
||||
getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding) const {
|
||||
getExprForDwarfGlobalReference(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.
|
||||
|
||||
if (Encoding & DW_EH_PE_indirect) {
|
||||
@ -782,12 +784,12 @@ getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
}
|
||||
|
||||
return TargetLoweringObjectFile::
|
||||
getSymbolForDwarfReference(Sym, MMI,
|
||||
Encoding & ~dwarf::DW_EH_PE_indirect);
|
||||
getExprForDwarfReference(Sym, MMI, Encoding & ~dwarf::DW_EH_PE_indirect,
|
||||
Streamer);
|
||||
}
|
||||
|
||||
return TargetLoweringObjectFile::
|
||||
getSymbolForDwarfGlobalReference(GV, Mang, MMI, Encoding);
|
||||
getExprForDwarfGlobalReference(GV, Mang, MMI, Encoding, Streamer);
|
||||
}
|
||||
|
||||
unsigned TargetLoweringObjectFileMachO::getPersonalityEncoding() const {
|
||||
|
@ -290,12 +290,13 @@ TargetLoweringObjectFile::getSectionForConstant(SectionKind Kind) const {
|
||||
return DataSection;
|
||||
}
|
||||
|
||||
/// getSymbolForDwarfGlobalReference - Return an MCExpr to use for a
|
||||
/// getExprForDwarfGlobalReference - Return an MCExpr to use for a
|
||||
/// reference to the specified global variable from exception
|
||||
/// handling information.
|
||||
const MCExpr *TargetLoweringObjectFile::
|
||||
getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding) const {
|
||||
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding,
|
||||
MCStreamer &Streamer) const {
|
||||
// FIXME: Use GetGlobalValueSymbol.
|
||||
SmallString<128> Name;
|
||||
Mang->getNameWithPrefix(Name, GV, false);
|
||||
@ -306,12 +307,12 @@ getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
else
|
||||
Sym = getContext().GetOrCreateSymbol(Name.str());
|
||||
|
||||
return getSymbolForDwarfReference(Sym, MMI, Encoding);
|
||||
return getExprForDwarfReference(Sym, MMI, Encoding, Streamer);
|
||||
}
|
||||
|
||||
const MCExpr *TargetLoweringObjectFile::
|
||||
getSymbolForDwarfReference(const MCSymbol *Sym, MachineModuleInfo *MMI,
|
||||
unsigned Encoding) const {
|
||||
getExprForDwarfReference(const MCSymbol *Sym, MachineModuleInfo *MMI,
|
||||
unsigned Encoding, MCStreamer &Streamer) const {
|
||||
const MCExpr *Res = MCSymbolRefExpr::Create(Sym, getContext());
|
||||
|
||||
switch (Encoding & 0xF0) {
|
||||
|
@ -19,9 +19,9 @@ using namespace llvm;
|
||||
using namespace dwarf;
|
||||
|
||||
const MCExpr *X8664_MachoTargetObjectFile::
|
||||
getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI,
|
||||
unsigned Encoding) const {
|
||||
getExprForDwarfGlobalReference(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.
|
||||
@ -40,7 +40,7 @@ getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
}
|
||||
|
||||
return TargetLoweringObjectFileMachO::
|
||||
getSymbolForDwarfGlobalReference(GV, Mang, MMI, Encoding);
|
||||
getExprForDwarfGlobalReference(GV, Mang, MMI, Encoding, Streamer);
|
||||
}
|
||||
|
||||
unsigned X8632_ELFTargetObjectFile::getPersonalityEncoding() const {
|
||||
|
@ -23,8 +23,9 @@ namespace llvm {
|
||||
public:
|
||||
|
||||
virtual const MCExpr *
|
||||
getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding) const;
|
||||
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
MachineModuleInfo *MMI, unsigned Encoding,
|
||||
MCStreamer &Streamer) const;
|
||||
};
|
||||
|
||||
class X8632_ELFTargetObjectFile : public TargetLoweringObjectFileELF {
|
||||
|
Loading…
x
Reference in New Issue
Block a user