summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/ELFObjectWriter.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2018-05-18 19:46:24 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2018-05-18 19:46:24 +0000
commite3f652973e6e4fb7074b0bdc2291493e6cb8fae5 (patch)
tree4fba9f86235380483550bf1268b185f9aa2865f5 /llvm/lib/MC/ELFObjectWriter.cpp
parent1fa76cc3ea1f3361dd4e6091ac6a5c0e833de6a4 (diff)
downloadbcm5719-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/MC/ELFObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 2255d059459..07b1d924e2b 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -183,10 +183,8 @@ public:
}
template <typename T> void write(T Val) {
- if (IsLittleEndian)
- support::endian::Writer<support::little>(getStream()).write(Val);
- else
- support::endian::Writer<support::big>(getStream()).write(Val);
+ support::endian::write(getStream(), Val,
+ IsLittleEndian ? support::little : support::big);
}
void writeHeader(const MCAssembler &Asm);
OpenPOWER on IntegriCloud