[llvm-commits] [llvm] r171413 - /llvm/trunk/include/llvm/ADT/Optional.h
Argyrios Kyrtzidis
akyrtzi at gmail.com
Wed Jan 2 13:19:10 PST 2013
Author: akirtzidis
Date: Wed Jan 2 15:19:08 2013
New Revision: 171413
URL: http://llvm.org/viewvc/llvm-project?rev=171413&view=rev
Log:
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.
Modified:
llvm/trunk/include/llvm/ADT/Optional.h
Modified: llvm/trunk/include/llvm/ADT/Optional.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=171413&r1=171412&r2=171413&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Optional.h (original)
+++ llvm/trunk/include/llvm/ADT/Optional.h Wed Jan 2 15:19:08 2013
@@ -28,7 +28,7 @@
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) {}
More information about the llvm-commits
mailing list