Use a bool instead of a bitfield in llvm/ADT/Optional.

Fixes Valgrind failures and removes bitwise operations that don't provide any benefit.
Valgrind failures reported by NAKAMURA Takumi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Argyrios Kyrtzidis 2013-01-02 21:19:08 +00:00
parent 3922757824
commit 23203faf0b

View File

@ -28,7 +28,7 @@ namespace llvm {
template<typename T>
class Optional {
T x;
unsigned hasVal : 1;
bool hasVal;
public:
explicit Optional() : x(), hasVal(false) {}
Optional(const T &y) : x(y), hasVal(true) {}