[cfe-commits] [Review] [ubsan] Deduplication
Richard Smith
richard at metafoo.co.uk
Mon Jan 7 20:16:53 PST 2013
Thanks! This patch is highlighting a pressing need to refactor out the
repetition in ubsan_handlers.cc...
The atomic compare-exchange isn't sufficient to remove the data race,
since the copy to the local Location object is non-atomic. How about
something like...
SourceLocation SourceLocation::acquire() {
return SourceLocation(Filename, Line,
__sync_val_compare_and_swap(&Column, Column, ~u32(0)));
}
bool SourceLocation::isDisabled() {
return Column == ~u32(0);
}
// ... then ...
SourceLocation Loc = Data->Loc.acquire();
if (Loc.isDisabled())
return;
On Mon, Jan 7, 2013 at 3:17 PM, Will Dietz <wdietz2 at illinois.edu> wrote:
> Updated, slightly neater patches attached.
>
> Thanks!
>
> ~Will
>
> On Tue, Jan 1, 2013 at 9:49 PM, Will Dietz <wdietz2 at illinois.edu> wrote:
>> Updated to apply cleanly to latest clang/compiler-rt.
>>
>> Thanks!
>>
>> ~Will
>>
>> On Sun, Dec 30, 2012 at 6:22 PM, Will Dietz <wdietz2 at illinois.edu> wrote:
>>> (Moving to cfe-commits@, was previously:
>>> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-December/026519.html)
>>>
>>> Please see attached! :)
>>>
>>> Thank you,
>>>
>>> ~Will
More information about the cfe-commits
mailing list