[cfe-commits] [PATCH] [Valgrind][check-clang] Optional.h: Appease Valgrind

NAKAMURA Takumi geek4civic at gmail.com
Fri Dec 14 09:02:38 PST 2012

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.



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;
   explicit Optional() : x(), hasVal(false) {}
   Optional(const T &y) : x(y), hasVal(true) {}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D218.1.patch
Type: text/x-patch
Size: 401 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121214/29607634/attachment.bin>

More information about the cfe-commits mailing list