diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-21 17:57:19 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-21 17:57:19 +0000 |
commit | 2da7ab576ad3602cf3576fdcab6ed3d92e658989 (patch) | |
tree | 34c47e1f3833990bdaa5e8b268c8587e078bcf25 /llvm/lib/Target/AVR | |
parent | e05be80fb8efdea067ef1a8eaef72c7140985290 (diff) |
MC: Change MCAsmBackend::writeNopData() to take a raw_ostream instead of an MCObjectWriter. NFCI.
To make this work I needed to add an endianness field to MCAsmBackend
so that writeNopData() implementations know which endianness to use.
Part of PR37466.
Differential Revision: https://reviews.llvm.org/D47035
Diffstat (limited to 'llvm/lib/Target/AVR')
-rw-r--r-- | llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp index 2f5e9f02e53..28c3e0af2ea 100644 --- a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp +++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp @@ -453,13 +453,13 @@ MCFixupKindInfo const &AVRAsmBackend::getFixupKindInfo(MCFixupKind Kind) const { return Infos[Kind - FirstTargetFixupKind]; } -bool AVRAsmBackend::writeNopData(uint64_t Count, MCObjectWriter *OW) const { +bool AVRAsmBackend::writeNopData(raw_ostream &OS, uint64_t Count) const { // If the count is not 2-byte aligned, we must be writing data into the text // section (otherwise we have unaligned instructions, and thus have far // bigger problems), so just write zeros instead. assert((Count % 2) == 0 && "NOP instructions must be 2 bytes"); - OW->WriteZeros(Count); + OS.write_zeros(Count); return true; } diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h index af615df033a..2d35f1a2bc0 100644 --- a/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h +++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h @@ -31,9 +31,8 @@ struct MCFixupKindInfo; /// Utilities for manipulating generated AVR machine code. class AVRAsmBackend : public MCAsmBackend { public: - AVRAsmBackend(Triple::OSType OSType) - : MCAsmBackend(), OSType(OSType) {} + : MCAsmBackend(support::little), OSType(OSType) {} void adjustFixupValue(const MCFixup &Fixup, const MCValue &Target, uint64_t &Value, MCContext *Ctx = nullptr) const; @@ -62,7 +61,7 @@ public: void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, MCInst &Res) const override {} - bool writeNopData(uint64_t Count, MCObjectWriter *OW) const override; + bool writeNopData(raw_ostream &OS, uint64_t Count) const override; bool shouldForceRelocation(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target) override; |