From d707c37072195e1e05edd8765b3f4bd79955b154 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 9 Jan 2018 22:48:37 +0000 Subject: Use a MCExpr for the size of MCFillFragment. This allows the size to be found during ralaxation. This fixes pr35858. llvm-svn: 322131 --- llvm/lib/MC/MCObjectStreamer.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'llvm/lib/MC/MCObjectStreamer.cpp') diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index 49fa4bb7dfa..230c02188a6 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -582,19 +582,8 @@ void MCObjectStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue, MCDataFragment *DF = getOrCreateDataFragment(); flushPendingLabels(DF, DF->getContents().size()); - int64_t IntNumBytes; - if (!NumBytes.evaluateAsAbsolute(IntNumBytes, getAssembler())) { - getContext().reportError(Loc, "expected absolute expression"); - return; - } - - if (IntNumBytes < 0) { - getContext().reportError(Loc, "invalid number of bytes"); - return; - } - assert(getCurrentSectionOnly() && "need a section"); - insert(new MCFillFragment(FillValue, IntNumBytes)); + insert(new MCFillFragment(FillValue, NumBytes, Loc)); } void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size, -- cgit v1.2.3