Use a MCExpr for the size of MCFillFragment.
This allows the size to be found during ralaxation. This fixes
pr35858.
llvm-svn: 322131
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index 49fa4bb..230c021 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -582,19 +582,8 @@
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,