Commit Graph

7 Commits

Author SHA1 Message Date
Artyom Skrobov 9aea8432c5 Using llvm::sys::swapByteOrder() for the common case of byte-swapping a value in place
llvm-svn: 210978
2014-06-14 13:18:07 +00:00
Artyom Skrobov ef5e867f16 Renaming SwapByteOrder() to getSwappedBytes()
The next commit will add swapByteOrder(), acting in-place

llvm-svn: 210973
2014-06-14 11:36:01 +00:00
Craig Topper c10719f55d [C++11] Make use of 'nullptr' in the Support library.
llvm-svn: 205697
2014-04-07 04:17:22 +00:00
Rafael Espindola 41cb64f4fa Make the host endianness check an integer constant expression.
I will remove the isBigEndianHost function once I update clang.

The ifdef logic is designed to
* not use configure/cmake to avoid breaking -arch i686 -arch ppc.
* default to little endian
* be as small as possible

It looks like sys/endian.h is the preferred header on most modern BSD systems,
but it is better to change this in a followup patch as machine/endian.h is
available on FreeBSD, OpenBSD, NetBSD and OS X.

llvm-svn: 179527
2013-04-15 14:44:24 +00:00
Benjamin Kramer 1b07ab51e4 DataExtractor: Fix integer truncation issues in LEB128 extraction.
llvm-svn: 162201
2012-08-20 10:52:11 +00:00
Chad Rosier 5dfe6dab25 Remove extra semi-colons.
llvm-svn: 151169
2012-02-22 17:25:00 +00:00
Benjamin Kramer 88a1d9fc00 Add the DataExtractor utility class.
It is an endian-aware helper that can read data from a StringRef. It will
come in handy for DWARF parsing. This class is inspired by LLDB's
DataExtractor, but is stripped down to the bare minimum needed for DWARF.

Comes with unit tests!

llvm-svn: 139626
2011-09-13 19:42:16 +00:00