[Error] Unify +Asserts/-Asserts behavior for checked flags in Error/Expected<T>.
authorLang Hames <lhames@gmail.com>
Fri, 28 Oct 2016 18:24:15 +0000 (18:24 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 28 Oct 2016 18:24:15 +0000 (18:24 +0000)
commita9682caf96198508e3601e1e8160aa5505c3f266
tree7bb88183713bd1be3c3260af4a427c802e6133bd
parent7e55f178255a235887d7751e33dabc4937d87879
[Error] Unify +Asserts/-Asserts behavior for checked flags in Error/Expected<T>.

(1) Switches to raw pointer and bitmasking operations for Error payload.
(2) Always includes the 'unchecked' bitfield in Expected<T>, even in -Asserts.
(3) Always propagates checked bit status in move-ops for both classes, even in
    -Asserts.

This should allow debug programs to link against release libraries without
encountering spurious 'unchecked error' terminations.

Error checks still aren't verified in release mode so this doesn't introduce
any new control flow, but it does require new bit-masking ops in release mode
to preserve the flag values during move ops. I expect the overhead to be
minimal, but if we discover any corner cases where it matters we could fix
this by making flag propagation conditional on a new build option.

llvm-svn: 285426
llvm/include/llvm/Support/Error.h