summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/EndianTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Support/Endian] Add support for endian-specific enumsPavel Labath2019-03-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Binary formats often include various enumerations or bitsets, but using endian-specific types for accessing them is tricky because they currently only support integral types. This is particularly true for scoped enums (enum class), as these are not implicitly convertible to integral types, and so one has to perform two casts just to read the enum value. This fixes that support by adding first-class support for enumeration types to endian-specific types. The support for them was already almost working -- all I needed to do was overload getSwappedBytes for enumeration types (which casts the enum to its underlying type and performs the conversion there). I also add some convenience template aliases to simplify declaring endian-specific enums. Reviewers: Bigcheese, zturner Subscribers: kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59141 llvm-svn: 355812
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix another UBSan test error from r248897 and follow on fix r249689Teresa Johnson2015-10-081-0/+84
| | | | | | | While here fix a few more issues with potential overflow and add new tests for these cases. Ensured that test now passes with UBSan. llvm-svn: 249745
* Add support for sub-byte aligned writes to lib/Support/Endian.hTeresa Johnson2015-09-301-0/+48
| | | | | | | | | | | | | | | Summary: As per Duncan's review for D12536, I extracted the sub-byte bit aligned reading and writing code into lib/Support, and generalized it. Added calls from BackpatchWord. Also added unittests. Reviewers: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13189 llvm-svn: 248897
* [Support][Endian] Add support for specifying the alignment and native ↵Michael J. Spencer2013-01-021-11/+11
| | | | | | | | | | | unaligned types. * Add support for specifying the alignment to use. * Add the concept of native endianness. Used for unaligned native types. The native alignment and read/write simplification is based on a patch by Richard Smith. llvm-svn: 171406
* Sort the #include lines for unittest/...Chandler Carruth2012-12-041-1/+1
| | | | llvm-svn: 169250
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120298
* Support: Add Endian.hMichael J. Spencer2010-10-211-0/+72
llvm-svn: 117057
OpenPOWER on IntegriCloud