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/Object/ArchiveWriter.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/Object/ArchiveWriter.cpp')
-rw-r--r-- | llvm/lib/Object/ArchiveWriter.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Object/ArchiveWriter.cpp b/llvm/lib/Object/ArchiveWriter.cpp index 1a0137eb26e..c9796736896 100644 --- a/llvm/lib/Object/ArchiveWriter.cpp +++ b/llvm/lib/Object/ArchiveWriter.cpp @@ -136,10 +136,8 @@ static bool isBSDLike(object::Archive::Kind Kind) { template <class T> static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val) { - if (isBSDLike(Kind)) - support::endian::Writer<support::little>(Out).write(Val); - else - support::endian::Writer<support::big>(Out).write(Val); + support::endian::write(Out, Val, + isBSDLike(Kind) ? support::little : support::big); } static void printRestOfMemberHeader( |