[lld] r332757 - Support: Simplify endian stream interface. NFCI.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 12:46:24 PDT 2018


Author: pcc
Date: Fri May 18 12:46:24 2018
New Revision: 332757

URL: http://llvm.org/viewvc/llvm-project?rev=332757&view=rev
Log:
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

Modified:
    lld/trunk/wasm/WriterUtils.cpp

Modified: lld/trunk/wasm/WriterUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/WriterUtils.cpp?rev=332757&r1=332756&r2=332757&view=diff
==============================================================================
--- lld/trunk/wasm/WriterUtils.cpp (original)
+++ lld/trunk/wasm/WriterUtils.cpp Fri May 18 12:46:24 2018
@@ -70,7 +70,7 @@ void wasm::writeU8(raw_ostream &OS, uint
 
 void wasm::writeU32(raw_ostream &OS, uint32_t Number, const Twine &Msg) {
   debugWrite(OS.tell(), Msg + "[0x" + utohexstr(Number) + "]");
-  support::endian::Writer<support::little>(OS).write(Number);
+  support::endian::write(OS, Number, support::little);
 }
 
 void wasm::writeValueType(raw_ostream &OS, uint8_t Type, const Twine &Msg) {




More information about the llvm-commits mailing list