[compiler-rt] r206199 - sanitizer_deadlock_detector.h: MSVC 2012 doesn't like compound literals

Hans Wennborg hans at chromium.org
Mon Apr 14 12:33:28 PDT 2014


On Mon, Apr 14, 2014 at 12:00 PM, Kostya Serebryany <kcc at google.com> wrote:
> Ugh. Is this a bug in MSVC 2012?

Bug / unimplemented feature, yes :/

> On Mon, Apr 14, 2014 at 9:43 PM, Hans Wennborg <hans at hanshq.net> wrote:
>>
>> Author: hans
>> Date: Mon Apr 14 12:43:45 2014
>> New Revision: 206199
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=206199&view=rev
>> Log:
>> sanitizer_deadlock_detector.h: MSVC 2012 doesn't like compound literals
>>
>> Modified:
>>     compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h
>>
>> Modified:
>> compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h?rev=206199&r1=206198&r2=206199&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h
>> (original)
>> +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_deadlock_detector.h
>> Mon Apr 14 12:43:45 2014
>> @@ -67,7 +67,8 @@ class DeadlockDetectorTLS {
>>      CHECK_LT(n_all_locks_, ARRAY_SIZE(all_locks_with_contexts_));
>>      // lock_id < BV::kSize, can cast to a smaller int.
>>      u32 lock_id_short = static_cast<u32>(lock_id);
>> -    all_locks_with_contexts_[n_all_locks_++] = {lock_id_short, stk};
>> +    LockWithContext l = {lock_id_short, stk};
>> +    all_locks_with_contexts_[n_all_locks_++] = l;
>>      return true;
>>    }
>>
>> @@ -244,10 +245,12 @@ class DeadlockDetector {
>>      uptr n_added_edges = g_.addEdges(dtls->getLocks(current_epoch_),
>> cur_idx,
>>                                       added_edges,
>> ARRAY_SIZE(added_edges));
>>      for (uptr i = 0; i < n_added_edges; i++) {
>> -      if (n_edges_ < ARRAY_SIZE(edges_))
>> -        edges_[n_edges_++] = {(u16)added_edges[i], (u16)cur_idx,
>> -                              dtls->findLockContext(added_edges[i]), stk,
>> -                              unique_tid};
>> +      if (n_edges_ < ARRAY_SIZE(edges_)) {
>> +        Edge e = {(u16)added_edges[i], (u16)cur_idx,
>> +                  dtls->findLockContext(added_edges[i]), stk,
>> +                  unique_tid};
>> +        edges_[n_edges_++] = e;
>> +      }
>>        // Printf("Edge%zd: %u %zd=>%zd in T%d\n",
>>        //        n_edges_, stk, added_edges[i], cur_idx, unique_tid);
>>      }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-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