mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Add the getExprForFDESymbol method that responsible for computing the
expressions used in the FDE to refer to symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130437 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
77562c74e5
commit
a0057ca13f
@ -328,6 +328,9 @@ namespace llvm {
|
||||
getExprForPersonalitySymbol(const MCSymbol *Sym,
|
||||
MCStreamer &Streamer) const;
|
||||
|
||||
virtual const MCExpr *
|
||||
getExprForFDESymbol(const MCSymbol *Sym, MCStreamer &Streamer) const;
|
||||
|
||||
bool usesSunStyleELFSectionSwitchSyntax() const {
|
||||
return SunStyleELFSectionSwitchSyntax;
|
||||
}
|
||||
|
@ -26,8 +26,7 @@ namespace llvm {
|
||||
struct MCAsmInfoDarwin : public MCAsmInfo {
|
||||
explicit MCAsmInfoDarwin();
|
||||
virtual const MCExpr *
|
||||
getExprForPersonalitySymbol(const MCSymbol *Sym,
|
||||
MCStreamer &Streamer) const;
|
||||
getExprForFDESymbol(const MCSymbol *Sym, MCStreamer &Streamer) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -112,5 +112,11 @@ unsigned MCAsmInfo::getSLEB128Size(int Value) {
|
||||
const MCExpr *
|
||||
MCAsmInfo::getExprForPersonalitySymbol(const MCSymbol *Sym,
|
||||
MCStreamer &Streamer) const {
|
||||
return getExprForFDESymbol(Sym, Streamer);
|
||||
}
|
||||
|
||||
const MCExpr *
|
||||
MCAsmInfo::getExprForFDESymbol(const MCSymbol *Sym,
|
||||
MCStreamer &Streamer) const {
|
||||
return MCSymbolRefExpr::Create(Sym, Streamer.getContext());
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
|
||||
}
|
||||
|
||||
const MCExpr *
|
||||
MCAsmInfoDarwin::getExprForPersonalitySymbol(const MCSymbol *Sym,
|
||||
MCStreamer &Streamer) const {
|
||||
MCAsmInfoDarwin::getExprForFDESymbol(const MCSymbol *Sym,
|
||||
MCStreamer &Streamer) const {
|
||||
MCContext &Context = Streamer.getContext();
|
||||
const MCExpr *Res = MCSymbolRefExpr::Create(Sym, Context);
|
||||
MCSymbol *PCSym = Context.CreateTempSymbol();
|
||||
|
@ -465,19 +465,16 @@ static unsigned getSizeForEncoding(MCStreamer &streamer,
|
||||
|
||||
static void EmitSymbol(MCStreamer &streamer, const MCSymbol &symbol,
|
||||
unsigned symbolEncoding) {
|
||||
MCContext &context = streamer.getContext();
|
||||
const MCAsmInfo &asmInfo = context.getAsmInfo();
|
||||
const MCExpr *v = asmInfo.getExprForFDESymbol(&symbol,
|
||||
streamer);
|
||||
unsigned size = getSizeForEncoding(streamer, symbolEncoding);
|
||||
unsigned application = symbolEncoding & 0x70;
|
||||
switch (application) {
|
||||
default:
|
||||
assert(0 && "Unknown Encoding");
|
||||
break;
|
||||
case 0:
|
||||
streamer.EmitSymbolValue(&symbol, size);
|
||||
break;
|
||||
case dwarf::DW_EH_PE_pcrel:
|
||||
streamer.EmitPCRelSymbolValue(&symbol, size);
|
||||
break;
|
||||
}
|
||||
if (isa<MCSymbolRefExpr>(v) && application == dwarf::DW_EH_PE_pcrel)
|
||||
streamer.EmitPCRelValue(v, size);
|
||||
else
|
||||
streamer.EmitAbsValue(v, size);
|
||||
}
|
||||
|
||||
static void EmitPersonality(MCStreamer &streamer, const MCSymbol &symbol,
|
||||
@ -756,7 +753,7 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
|
||||
unsigned size = getSizeForEncoding(streamer, fdeEncoding);
|
||||
|
||||
// PC Begin
|
||||
streamer.EmitPCRelSymbolValue(frame.Begin, size);
|
||||
EmitSymbol(streamer, *frame.Begin, fdeEncoding);
|
||||
|
||||
// PC Range
|
||||
const MCExpr *Range = MakeStartMinusEndExpr(streamer, *frame.Begin,
|
||||
|
Loading…
Reference in New Issue
Block a user