Use a bool instead of a bitfield in llvm/ADT/Optional.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 2 Jan 2013 21:19:08 +0000 (21:19 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 2 Jan 2013 21:19:08 +0000 (21:19 +0000)
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

include/llvm/ADT/Optional.h

index aa43f552d501df15cea382ef82d5a58799254a8f..06e5af073f4061bea2f6c78b7c2b9f0438223278 100644 (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) {}