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

David Blaikie dblaikie at gmail.com
Fri Dec 14 10:44:02 PST 2012


On Fri, Dec 14, 2012 at 10:38 AM, Argyrios Kyrtzidis <akyrtzi at gmail.com> 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 <geek4civic at gmail.com> 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
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list