diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-18 19:46:24 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2018-05-18 19:46:24 +0000 |
commit | e3f652973e6e4fb7074b0bdc2291493e6cb8fae5 (patch) | |
tree | 4fba9f86235380483550bf1268b185f9aa2865f5 /llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp | |
parent | 1fa76cc3ea1f3361dd4e6091ac6a5c0e833de6a4 (diff) | |
download | bcm5719-llvm-e3f652973e6e4fb7074b0bdc2291493e6cb8fae5.tar.gz bcm5719-llvm-e3f652973e6e4fb7074b0bdc2291493e6cb8fae5.zip |
Support: Simplify endian stream interface. NFCI.
Provide some free functions to reduce verbosity of endian-writing
a single value, and replace the endianness template parameter with
a field.
Part of PR37466.
Differential Revision: https://reviews.llvm.org/D47032
llvm-svn: 332757
Diffstat (limited to 'llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp')
-rw-r--r-- | llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp index b10cf79dc67..ad0e27d5c24 100644 --- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp +++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp @@ -113,12 +113,12 @@ void RISCVMCCodeEmitter::expandFunctionCall(const MCInst &MI, raw_ostream &OS, .addReg(Ra) .addOperand(MCOperand::createExpr(CallExpr)); Binary = getBinaryCodeForInstr(TmpInst, Fixups, STI); - support::endian::Writer<support::little>(OS).write(Binary); + support::endian::write(OS, Binary, support::little); // Emit JALR Ra, Ra, 0 TmpInst = MCInstBuilder(RISCV::JALR).addReg(Ra).addReg(Ra).addImm(0); Binary = getBinaryCodeForInstr(TmpInst, Fixups, STI); - support::endian::Writer<support::little>(OS).write(Binary); + support::endian::write(OS, Binary, support::little); } void RISCVMCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS, @@ -140,12 +140,12 @@ void RISCVMCCodeEmitter::encodeInstruction(const MCInst &MI, raw_ostream &OS, llvm_unreachable("Unhandled encodeInstruction length!"); case 2: { uint16_t Bits = getBinaryCodeForInstr(MI, Fixups, STI); - support::endian::Writer<support::little>(OS).write<uint16_t>(Bits); + support::endian::write<uint16_t>(OS, Bits, support::little); break; } case 4: { uint32_t Bits = getBinaryCodeForInstr(MI, Fixups, STI); - support::endian::Writer<support::little>(OS).write(Bits); + support::endian::write(OS, Bits, support::little); break; } } |