diff options
author | Hans Wennborg <hans@hanshq.net> | 2018-01-30 09:31:00 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2018-01-30 09:31:00 +0000 |
commit | 98b79f2cd78d57b8e5f5307ac889fa264cddcc36 (patch) | |
tree | 7636da279d64d7a07d0580e24e617f06ca3ad6fd /include | |
parent | f1286127b73c0d81ced8595af62e78ed703ced8b (diff) |
Merging r322108, r322123 and r322131:
------------------------------------------------------------------------
r322108 | rafael | 2018-01-09 20:29:33 +0100 (Tue, 09 Jan 2018) | 3 lines
Make one of the emitFill methods non virtual. NFC.
This is just preparatory work to fix PR35858.
------------------------------------------------------------------------
------------------------------------------------------------------------
r322123 | rafael | 2018-01-09 22:55:10 +0100 (Tue, 09 Jan 2018) | 3 lines
Don't create MCFillFragment directly.
Instead use higher level APIs that take care of most bookkeeping.
------------------------------------------------------------------------
------------------------------------------------------------------------
r322131 | rafael | 2018-01-09 23:48:37 +0100 (Tue, 09 Jan 2018) | 4 lines
Use a MCExpr for the size of MCFillFragment.
This allows the size to be found during ralaxation. This fixes
pr35858.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@323735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCFragment.h | 15 | ||||
-rw-r--r-- | include/llvm/MC/MCObjectStreamer.h | 1 | ||||
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/include/llvm/MC/MCFragment.h b/include/llvm/MC/MCFragment.h index 7ebde03a758c..85b55e85469a 100644 --- a/include/llvm/MC/MCFragment.h +++ b/include/llvm/MC/MCFragment.h @@ -422,14 +422,21 @@ class MCFillFragment : public MCFragment { uint8_t Value; /// The number of bytes to insert. - uint64_t Size; + const MCExpr &Size; + + /// Source location of the directive that this fragment was created for. + SMLoc Loc; public: - MCFillFragment(uint8_t Value, uint64_t Size, MCSection *Sec = nullptr) - : MCFragment(FT_Fill, false, 0, Sec), Value(Value), Size(Size) {} + MCFillFragment(uint8_t Value, const MCExpr &Size, SMLoc Loc, + MCSection *Sec = nullptr) + : MCFragment(FT_Fill, false, 0, Sec), Value(Value), Size(Size), Loc(Loc) { + } uint8_t getValue() const { return Value; } - uint64_t getSize() const { return Size; } + const MCExpr &getSize() const { return Size; } + + SMLoc getLoc() const { return Loc; } static bool classof(const MCFragment *F) { return F->getKind() == MCFragment::FT_Fill; diff --git a/include/llvm/MC/MCObjectStreamer.h b/include/llvm/MC/MCObjectStreamer.h index a3dbc56ebc10..43ed00b4a7a7 100644 --- a/include/llvm/MC/MCObjectStreamer.h +++ b/include/llvm/MC/MCObjectStreamer.h @@ -161,7 +161,6 @@ public: bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc) override; using MCStreamer::emitFill; - void emitFill(uint64_t NumBytes, uint8_t FillValue) override; void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()) override; void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index a82051700708..28b326ae9b87 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -662,7 +662,7 @@ public: /// \brief Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. - virtual void emitFill(uint64_t NumBytes, uint8_t FillValue); + void emitFill(uint64_t NumBytes, uint8_t FillValue); /// \brief Emit \p Size bytes worth of the value specified by \p FillValue. /// |