summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/MCTargetDesc
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-05-21 17:57:19 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-05-21 17:57:19 +0000
commit571a3301aeaaddcb1d784d8f27957170fe0cfd15 (patch)
tree68b8fadb711472ead3443a2b0352d21eadb7d405 /llvm/lib/Target/WebAssembly/MCTargetDesc
parenta91ce17b5f2bbaa909aaa61a4610316de06f18cb (diff)
downloadbcm5719-llvm-571a3301aeaaddcb1d784d8f27957170fe0cfd15.tar.gz
bcm5719-llvm-571a3301aeaaddcb1d784d8f27957170fe0cfd15.zip
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 llvm-svn: 332857
Diffstat (limited to 'llvm/lib/Target/WebAssembly/MCTargetDesc')
-rw-r--r--llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp
index 9c3a72a1681..03e9a5febdc 100644
--- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp
+++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyAsmBackend.cpp
@@ -34,7 +34,7 @@ class WebAssemblyAsmBackendELF final : public MCAsmBackend {
public:
explicit WebAssemblyAsmBackendELF(bool Is64Bit)
- : MCAsmBackend(), Is64Bit(Is64Bit) {}
+ : MCAsmBackend(support::little), Is64Bit(Is64Bit) {}
~WebAssemblyAsmBackendELF() override {}
void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
@@ -62,7 +62,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;
};
class WebAssemblyAsmBackend final : public MCAsmBackend {
@@ -70,7 +70,7 @@ class WebAssemblyAsmBackend final : public MCAsmBackend {
public:
explicit WebAssemblyAsmBackend(bool Is64Bit)
- : MCAsmBackend(), Is64Bit(Is64Bit) {}
+ : MCAsmBackend(support::little), Is64Bit(Is64Bit) {}
~WebAssemblyAsmBackend() override {}
unsigned getNumFixupKinds() const override {
@@ -98,13 +98,13 @@ 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 WebAssemblyAsmBackendELF::writeNopData(uint64_t Count,
- MCObjectWriter *OW) const {
+bool WebAssemblyAsmBackendELF::writeNopData(raw_ostream &OS,
+ uint64_t Count) const {
for (uint64_t i = 0; i < Count; ++i)
- OW->write8(WebAssembly::Nop);
+ OS << char(WebAssembly::Nop);
return true;
}
@@ -158,13 +158,13 @@ WebAssemblyAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
return Infos[Kind - FirstTargetFixupKind];
}
-bool WebAssemblyAsmBackend::writeNopData(uint64_t Count,
- MCObjectWriter *OW) const {
+bool WebAssemblyAsmBackend::writeNopData(raw_ostream &OS,
+ uint64_t Count) const {
if (Count == 0)
return true;
for (uint64_t i = 0; i < Count; ++i)
- OW->write8(WebAssembly::Nop);
+ OS << char(WebAssembly::Nop);
return true;
}
OpenPOWER on IntegriCloud