This looks like 'hasVal' can be bool, and Optional<T> specialized to contain a PointerIntPair if T is pointer; any objections ?
On Dec 14, 2012, at 9:02 AM, NAKAMURA Takumi <[email protected]> wrote: > It seems small bitfield confuses valgrind. > This patch makes a bitfiled to (valgrind-recognizable) i8 size. > > I am using; > valgrind-3.6.0 x86-64 > > It caused bunch of failures in clang/test/Modules with --vg. > > http://llvm-reviews.chandlerc.com/D218 > > Files: > llvm/include/llvm/ADT/Optional.h > > Index: llvm/include/llvm/ADT/Optional.h > =================================================================== > --- llvm/include/llvm/ADT/Optional.h > +++ llvm/include/llvm/ADT/Optional.h > @@ -28,7 +28,7 @@ > template<typename T> > class Optional { > T x; > - unsigned hasVal : 1; > + unsigned char hasVal; > public: > explicit Optional() : x(), hasVal(false) {} > Optional(const T &y) : x(y), hasVal(true) {} > <D218.1.patch>_______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
