From: Rafael Espindola Date: Tue, 9 Jan 2018 19:50:29 +0000 (+0000) Subject: Inline a emitFill variant that is only used once. NFC. X-Git-Tag: android-x86-7.1-r4~6457 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c50bdd9ce60acda04a0596298ab4e25e3d562bf5;p=android-x86%2Fexternal-llvm.git Inline a emitFill variant that is only used once. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322111 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 28b326ae9b8..44041bc7ca4 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -682,7 +682,6 @@ public: /// \param NumValues - The number of copies of \p Size bytes to emit. /// \param Size - The size (in bytes) of each repeated value. /// \param Expr - The expression from which \p Size bytes are used. - virtual void emitFill(uint64_t NumValues, int64_t Size, int64_t Expr); virtual void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, SMLoc Loc = SMLoc()); diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index bddd264fe30..b82dcbdc0f7 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -195,8 +195,6 @@ public: void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()) override; - void emitFill(uint64_t NumValues, int64_t Size, int64_t Expr) override; - void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, SMLoc Loc = SMLoc()) override; @@ -981,14 +979,6 @@ void MCAsmStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue, MCStreamer::emitFill(NumBytes, FillValue); } -void MCAsmStreamer::emitFill(uint64_t NumValues, int64_t Size, int64_t Expr) { - if (NumValues == 0) - return; - - const MCExpr *E = MCConstantExpr::create(NumValues, getContext()); - emitFill(*E, Size, Expr); -} - void MCAsmStreamer::emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, SMLoc Loc) { // FIXME: Emit location directives diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 699cb2dd4b9..49fa4bb7dfa 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -612,7 +612,13 @@ void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size, return; } - MCStreamer::emitFill(IntNumValues, Size, Expr); + int64_t NonZeroSize = Size > 4 ? 4 : Size; + Expr &= ~0ULL >> (64 - NonZeroSize * 8); + for (uint64_t i = 0, e = IntNumValues; i != e; ++i) { + EmitIntValue(Expr, NonZeroSize); + if (NonZeroSize < Size) + EmitIntValue(0, Size - NonZeroSize); + } } void MCObjectStreamer::EmitFileDirective(StringRef Filename) { diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index ed10ccbbb74..af1fc5277db 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -187,16 +187,6 @@ void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue); } -void MCStreamer::emitFill(uint64_t NumValues, int64_t Size, int64_t Expr) { - int64_t NonZeroSize = Size > 4 ? 4 : Size; - Expr &= ~0ULL >> (64 - NonZeroSize * 8); - for (uint64_t i = 0, e = NumValues; i != e; ++i) { - EmitIntValue(Expr, NonZeroSize); - if (NonZeroSize < Size) - EmitIntValue(0, Size - NonZeroSize); - } -} - /// The implementation in this class just redirects to emitFill. void MCStreamer::EmitZeros(uint64_t NumBytes) { emitFill(NumBytes, 0);