On Fri, Dec 14, 2012 at 10:38 AM, Argyrios Kyrtzidis <[email protected]> wrote: > This looks like 'hasVal' can be bool, and Optional<T> specialized to contain > a PointerIntPair if T is pointer; any objections ?
Benjamin & I have tossed around similar ideas on IRC last week - doesn't seem like an unreasonable idea. > > 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 > > > _______________________________________________ > llvm-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
