mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-02 13:21:43 +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,
|
getExprForPersonalitySymbol(const MCSymbol *Sym,
|
||||||
MCStreamer &Streamer) const;
|
MCStreamer &Streamer) const;
|
||||||
|
|
||||||
|
virtual const MCExpr *
|
||||||
|
getExprForFDESymbol(const MCSymbol *Sym, MCStreamer &Streamer) const;
|
||||||
|
|
||||||
bool usesSunStyleELFSectionSwitchSyntax() const {
|
bool usesSunStyleELFSectionSwitchSyntax() const {
|
||||||
return SunStyleELFSectionSwitchSyntax;
|
return SunStyleELFSectionSwitchSyntax;
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,7 @@ namespace llvm {
|
|||||||
struct MCAsmInfoDarwin : public MCAsmInfo {
|
struct MCAsmInfoDarwin : public MCAsmInfo {
|
||||||
explicit MCAsmInfoDarwin();
|
explicit MCAsmInfoDarwin();
|
||||||
virtual const MCExpr *
|
virtual const MCExpr *
|
||||||
getExprForPersonalitySymbol(const MCSymbol *Sym,
|
getExprForFDESymbol(const MCSymbol *Sym, MCStreamer &Streamer) const;
|
||||||
MCStreamer &Streamer) const;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,5 +112,11 @@ unsigned MCAsmInfo::getSLEB128Size(int Value) {
|
|||||||
const MCExpr *
|
const MCExpr *
|
||||||
MCAsmInfo::getExprForPersonalitySymbol(const MCSymbol *Sym,
|
MCAsmInfo::getExprForPersonalitySymbol(const MCSymbol *Sym,
|
||||||
MCStreamer &Streamer) const {
|
MCStreamer &Streamer) const {
|
||||||
|
return getExprForFDESymbol(Sym, Streamer);
|
||||||
|
}
|
||||||
|
|
||||||
|
const MCExpr *
|
||||||
|
MCAsmInfo::getExprForFDESymbol(const MCSymbol *Sym,
|
||||||
|
MCStreamer &Streamer) const {
|
||||||
return MCSymbolRefExpr::Create(Sym, Streamer.getContext());
|
return MCSymbolRefExpr::Create(Sym, Streamer.getContext());
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,8 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MCExpr *
|
const MCExpr *
|
||||||
MCAsmInfoDarwin::getExprForPersonalitySymbol(const MCSymbol *Sym,
|
MCAsmInfoDarwin::getExprForFDESymbol(const MCSymbol *Sym,
|
||||||
MCStreamer &Streamer) const {
|
MCStreamer &Streamer) const {
|
||||||
MCContext &Context = Streamer.getContext();
|
MCContext &Context = Streamer.getContext();
|
||||||
const MCExpr *Res = MCSymbolRefExpr::Create(Sym, Context);
|
const MCExpr *Res = MCSymbolRefExpr::Create(Sym, Context);
|
||||||
MCSymbol *PCSym = Context.CreateTempSymbol();
|
MCSymbol *PCSym = Context.CreateTempSymbol();
|
||||||
|
@ -465,19 +465,16 @@ static unsigned getSizeForEncoding(MCStreamer &streamer,
|
|||||||
|
|
||||||
static void EmitSymbol(MCStreamer &streamer, const MCSymbol &symbol,
|
static void EmitSymbol(MCStreamer &streamer, const MCSymbol &symbol,
|
||||||
unsigned symbolEncoding) {
|
unsigned symbolEncoding) {
|
||||||
|
MCContext &context = streamer.getContext();
|
||||||
|
const MCAsmInfo &asmInfo = context.getAsmInfo();
|
||||||
|
const MCExpr *v = asmInfo.getExprForFDESymbol(&symbol,
|
||||||
|
streamer);
|
||||||
unsigned size = getSizeForEncoding(streamer, symbolEncoding);
|
unsigned size = getSizeForEncoding(streamer, symbolEncoding);
|
||||||
unsigned application = symbolEncoding & 0x70;
|
unsigned application = symbolEncoding & 0x70;
|
||||||
switch (application) {
|
if (isa<MCSymbolRefExpr>(v) && application == dwarf::DW_EH_PE_pcrel)
|
||||||
default:
|
streamer.EmitPCRelValue(v, size);
|
||||||
assert(0 && "Unknown Encoding");
|
else
|
||||||
break;
|
streamer.EmitAbsValue(v, size);
|
||||||
case 0:
|
|
||||||
streamer.EmitSymbolValue(&symbol, size);
|
|
||||||
break;
|
|
||||||
case dwarf::DW_EH_PE_pcrel:
|
|
||||||
streamer.EmitPCRelSymbolValue(&symbol, size);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void EmitPersonality(MCStreamer &streamer, const MCSymbol &symbol,
|
static void EmitPersonality(MCStreamer &streamer, const MCSymbol &symbol,
|
||||||
@ -756,7 +753,7 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
|
|||||||
unsigned size = getSizeForEncoding(streamer, fdeEncoding);
|
unsigned size = getSizeForEncoding(streamer, fdeEncoding);
|
||||||
|
|
||||||
// PC Begin
|
// PC Begin
|
||||||
streamer.EmitPCRelSymbolValue(frame.Begin, size);
|
EmitSymbol(streamer, *frame.Begin, fdeEncoding);
|
||||||
|
|
||||||
// PC Range
|
// PC Range
|
||||||
const MCExpr *Range = MakeStartMinusEndExpr(streamer, *frame.Begin,
|
const MCExpr *Range = MakeStartMinusEndExpr(streamer, *frame.Begin,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user