Go to file
Chandler Carruth 6145f7dadc [ADT] Add an abstraction for embedding an integer within a pointer-like
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
2016-01-10 09:40:13 +00:00
clang clang-format: Fix the counting of leading whitespace in tok::unknown tokens 2016-01-09 21:12:45 +00:00
clang-tools-extra [clang-tidy] Add non-inline function definition and variable definition check in header files. 2016-01-08 16:37:11 +00:00
compiler-rt [cfi] Fix __cfi_slowpath and __cfi_check signature. 2016-01-08 23:42:30 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc AMDGPU: Add aliases for all VI targets 2015-12-15 18:37:04 +00:00
libcxx Revert "Remove visibility attributes from out-of-class method definitions in iostreams." 2016-01-08 19:21:02 +00:00
libcxxabi Add new tests for throwing incomplete pointer types 2015-12-23 07:04:32 +00:00
libunwind Replace cmake check for printf with a check for fopen. 2015-12-10 00:47:08 +00:00
lld COFF: Implement DLL symbol forwarding. 2016-01-09 01:22:00 +00:00
lldb Writing a test case for r257234 I found another place that was 2016-01-09 01:20:30 +00:00
llgo [llgo] Force exporting __morestack from llgoi 2015-11-27 04:46:46 +00:00
llvm [ADT] Add an abstraction for embedding an integer within a pointer-like 2016-01-10 09:40:13 +00:00
openmp Removed unused __kmp_*_i8 functions. 2016-01-04 23:20:26 +00:00
polly Call assumeNoOutOfBound only in updateDimensionality 2016-01-08 14:01:59 +00:00