From 23203faf0b36c263248f5b265530c56974d93c98 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 2 Jan 2013 21:19:08 +0000 Subject: [PATCH] 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 --- include/llvm/ADT/Optional.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/ADT/Optional.h b/include/llvm/ADT/Optional.h index aa43f552d50..06e5af073f4 100644 --- a/include/llvm/ADT/Optional.h +++ b/include/llvm/ADT/Optional.h @@ -28,7 +28,7 @@ namespace llvm { template class Optional { T x; - unsigned hasVal : 1; + bool hasVal; public: explicit Optional() : x(), hasVal(false) {} Optional(const T &y) : x(y), hasVal(true) {} -- 2.11.0