1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Misc code refactorings:

* Remove unnecessary arguments now that ForceExpAbs is a method.
* Use ForceExpAbs in EmitAbsValue.

llvm-svn: 131683
This commit is contained in:
Rafael Espindola 2011-05-19 21:40:34 +00:00
parent 74a9e350d2
commit c03bb178a0
4 changed files with 14 additions and 21 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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());
}

View File

@ -42,13 +42,12 @@ const MCExpr *MCStreamer::BuildSymbolDiff(MCContext &Context,
return AddrDelta;
}
const MCExpr *MCStreamer::ForceExpAbs(MCStreamer *Streamer,
MCContext &Context, const MCExpr* Expr) {
const MCExpr *MCStreamer::ForceExpAbs(const MCExpr* Expr) {
if (Context.getAsmInfo().hasAggressiveSymbolFolding())
return Expr;
MCSymbol *ABS = Context.CreateTempSymbol();
Streamer->EmitAssignment(ABS, Expr);
EmitAssignment(ABS, Expr);
return MCSymbolRefExpr::Create(ABS, Context);
}
@ -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);
}