diff --git a/include/llvm/MC/MCObjectStreamer.h b/include/llvm/MC/MCObjectStreamer.h index 4772b748e60..1bd4cfad14d 100644 --- a/include/llvm/MC/MCObjectStreamer.h +++ b/include/llvm/MC/MCObjectStreamer.h @@ -78,7 +78,7 @@ protected: /// fragment is not a data fragment. MCDataFragment *getOrCreateDataFragment() const; - const MCExpr *AddValueSymbols(const MCExpr *Value); + void AddValueSymbols(const MCExpr *Value); public: MCAssembler &getAssembler() { return *Assembler; } diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 2722565332f..1b5033a3a2e 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -83,7 +83,7 @@ MCDataFragment *MCObjectStreamer::getOrCreateDataFragment() const { return F; } -const MCExpr *MCObjectStreamer::AddValueSymbols(const MCExpr *Value) { +void MCObjectStreamer::AddValueSymbols(const MCExpr *Value) { switch (Value->getKind()) { case MCExpr::Target: cast(Value)->AddValueSymbols(Assembler); @@ -107,8 +107,6 @@ const MCExpr *MCObjectStreamer::AddValueSymbols(const MCExpr *Value) { AddValueSymbols(cast(Value)->getSubExpr()); break; } - - return Value; } void MCObjectStreamer::EmitCFISections(bool EH, bool Debug) { @@ -125,7 +123,8 @@ void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, // Avoid fixups when possible. int64_t AbsValue; - if (AddValueSymbols(Value)->EvaluateAsAbsolute(AbsValue, getAssembler())) { + AddValueSymbols(Value); + if (Value->EvaluateAsAbsolute(AbsValue, getAssembler())) { EmitIntValue(AbsValue, Size); return; }