mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Misc code refactorings:
* Remove unnecessary arguments now that ForceExpAbs is a method. * Use ForceExpAbs in EmitAbsValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131683 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2bbecd8f6d
commit
a6f2678f08
@ -76,8 +76,7 @@ namespace llvm {
|
||||
const MCExpr *BuildSymbolDiff(MCContext &Context, const MCSymbol *A,
|
||||
const MCSymbol *B);
|
||||
|
||||
const MCExpr *ForceExpAbs(MCStreamer *Streamer, MCContext &Context,
|
||||
const MCExpr* Expr);
|
||||
const MCExpr *ForceExpAbs(const MCExpr* Expr);
|
||||
|
||||
void EmitFrames(bool usingCFI);
|
||||
|
||||
|
@ -368,7 +368,7 @@ void MCAsmStreamer::EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
|
||||
const MCSymbol *Label) {
|
||||
EmitIntValue(dwarf::DW_CFA_advance_loc4, 1);
|
||||
const MCExpr *AddrDelta = BuildSymbolDiff(getContext(), Label, LastLabel);
|
||||
AddrDelta = ForceExpAbs(this, getContext(), AddrDelta);
|
||||
AddrDelta = ForceExpAbs(AddrDelta);
|
||||
EmitValue(AddrDelta, 4);
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ void MCObjectStreamer::EmitULEB128Value(const MCExpr *Value) {
|
||||
EmitULEB128IntValue(IntValue);
|
||||
return;
|
||||
}
|
||||
Value = ForceExpAbs(this, getContext(), Value);
|
||||
Value = ForceExpAbs(Value);
|
||||
new MCLEBFragment(*Value, false, getCurrentSectionData());
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ void MCObjectStreamer::EmitSLEB128Value(const MCExpr *Value) {
|
||||
EmitSLEB128IntValue(IntValue);
|
||||
return;
|
||||
}
|
||||
Value = ForceExpAbs(this, getContext(), Value);
|
||||
Value = ForceExpAbs(Value);
|
||||
new MCLEBFragment(*Value, true, getCurrentSectionData());
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ void MCObjectStreamer::EmitDwarfAdvanceLineAddr(int64_t LineDelta,
|
||||
MCDwarfLineAddr::Emit(this, LineDelta, Res);
|
||||
return;
|
||||
}
|
||||
AddrDelta = ForceExpAbs(this, getContext(), AddrDelta);
|
||||
AddrDelta = ForceExpAbs(AddrDelta);
|
||||
new MCDwarfLineAddrFragment(LineDelta, *AddrDelta, getCurrentSectionData());
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ void MCObjectStreamer::EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
|
||||
MCDwarfFrameEmitter::EmitAdvanceLoc(*this, Res);
|
||||
return;
|
||||
}
|
||||
AddrDelta = ForceExpAbs(this, getContext(), AddrDelta);
|
||||
AddrDelta = ForceExpAbs(AddrDelta);
|
||||
new MCDwarfCallFrameFragment(*AddrDelta, getCurrentSectionData());
|
||||
}
|
||||
|
||||
|
@ -42,14 +42,13 @@ const MCExpr *MCStreamer::BuildSymbolDiff(MCContext &Context,
|
||||
return AddrDelta;
|
||||
}
|
||||
|
||||
const MCExpr *MCStreamer::ForceExpAbs(MCStreamer *Streamer,
|
||||
MCContext &Context, const MCExpr* Expr) {
|
||||
if (Context.getAsmInfo().hasAggressiveSymbolFolding())
|
||||
return Expr;
|
||||
const MCExpr *MCStreamer::ForceExpAbs(const MCExpr* Expr) {
|
||||
if (Context.getAsmInfo().hasAggressiveSymbolFolding())
|
||||
return Expr;
|
||||
|
||||
MCSymbol *ABS = Context.CreateTempSymbol();
|
||||
Streamer->EmitAssignment(ABS, Expr);
|
||||
return MCSymbolRefExpr::Create(ABS, Context);
|
||||
MCSymbol *ABS = Context.CreateTempSymbol();
|
||||
EmitAssignment(ABS, Expr);
|
||||
return MCSymbolRefExpr::Create(ABS, Context);
|
||||
}
|
||||
|
||||
raw_ostream &MCStreamer::GetCommentOS() {
|
||||
@ -103,13 +102,8 @@ void MCStreamer::EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace) {
|
||||
|
||||
void MCStreamer::EmitAbsValue(const MCExpr *Value, unsigned Size,
|
||||
unsigned AddrSpace) {
|
||||
if (getContext().getAsmInfo().hasAggressiveSymbolFolding()) {
|
||||
EmitValue(Value, Size, AddrSpace);
|
||||
return;
|
||||
}
|
||||
MCSymbol *ABS = getContext().CreateTempSymbol();
|
||||
EmitAssignment(ABS, Value);
|
||||
EmitSymbolValue(ABS, Size, AddrSpace);
|
||||
const MCExpr *ABS = ForceExpAbs(Value);
|
||||
EmitValue(ABS, Size, AddrSpace);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user