summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/PointerEmbeddedIntTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Re-sort #include lines for unittests. This uses a slightly modifiedChandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | clang-format (https://reviews.llvm.org/D33932) to keep primary headers at the top and handle new utility headers like 'gmock' consistently with other utility headers. No other change was made. I did no manual edits, all of this is clang-format. This should allow other changes to have more clear and focused diffs, and is especially motivated by moving some headers into more focused libraries. llvm-svn: 304786
* [ADT] Fix PointerEmbeddedInt when the underlying type is uintptr_t.Jordan Rose2016-02-181-0/+34
| | | | | | ...and when you try to store negative values in it. llvm-svn: 261259
* [ADT] Add an abstraction for embedding an integer within a pointer-likeChandler Carruth2016-01-101-0/+46
type. This makes it easy and safe to use a set of flags as one elmenet of a tagged union with pointers. There is quite a bit of code that has historically done this by casting arbitrary integers to "pointers" and assuming that this was safe and reliable. It is neither, and has started to rear its head by triggering safety asserts in various abstractions like PointerLikeTypeTraits when the integers chosen are invariably poor choices for *some* platform and *some* situation. Not to mention the (hopefully unlikely) prospect of one of these integers actually getting allocated! With this, it will be straightforward to build type safe abstractions like this without being error prone. The abstraction itself is also remarkably simple thanks to the implicit conversion. This use case and pattern was also independently created by the folks working on Swift, and they're going to incrementally add any missing functionality they find. Differential Revision: http://reviews.llvm.org/D15844 llvm-svn: 257284
OpenPOWER on IntegriCloud