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

Inline a emitFill variant that is only used once. NFC.

llvm-svn: 322111
This commit is contained in:
Rafael Espindola 2018-01-09 19:50:29 +00:00
parent f04207e3b2
commit 8c62496ec5
4 changed files with 7 additions and 22 deletions

View File

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

View File

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

View File

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

View File

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