Make ForceExpAbs an static helper.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215715 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-08-15 14:24:41 +00:00
parent 216fdfe9ac
commit abe3774e07
2 changed files with 4 additions and 5 deletions

View File

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

View File

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