diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 2ffdb84215d..d10ac0f7ef7 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -199,8 +199,6 @@ protected: const MCExpr *BuildSymbolDiff(MCContext &Context, const MCSymbol *A, const MCSymbol *B); - const MCExpr *ForceExpAbs(const MCExpr *Expr); - virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame); virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame); diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 9ee5dec8b31..ffbdc7111d5 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -69,13 +69,14 @@ const MCExpr *MCStreamer::BuildSymbolDiff(MCContext &Context, return AddrDelta; } -const MCExpr *MCStreamer::ForceExpAbs(const MCExpr* Expr) { +static const MCExpr *forceExpAbs(MCStreamer &OS, const MCExpr* Expr) { + MCContext &Context = OS.getContext(); assert(!isa(Expr)); if (Context.getAsmInfo()->hasAggressiveSymbolFolding()) return Expr; MCSymbol *ABS = Context.CreateTempSymbol(); - EmitAssignment(ABS, Expr); + OS.EmitAssignment(ABS, Expr); return MCSymbolRefExpr::Create(ABS, Context); } @@ -138,7 +139,7 @@ void MCStreamer::EmitSLEB128IntValue(int64_t Value) { } void MCStreamer::EmitAbsValue(const MCExpr *Value, unsigned Size) { - const MCExpr *ABS = ForceExpAbs(Value); + const MCExpr *ABS = forceExpAbs(*this, Value); EmitValue(ABS, Size); }