[libcxx-commits] [PATCH] D65667: [libcxx] Avoid destructor call for error_category singletons

Hubert Tong via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 23 17:20:48 PDT 2019


On Fri, Aug 23, 2019 at 6:56 PM Eric Fiselier <eric at efcs.ca> wrote:

> Have you looked at the codegen clang produces for my suggestion?
>
I had to use no_destroy to see the desired effect of suppressing the
__cxa_atexit call, and even then there was an empty initialization function.
https://gcc.godbolt.org/z/tVSf47

Clang is also not the only compiler that people have to work with.


>
>
> On Fri., Aug. 23, 2019, 3:01 p.m. Hubert Tong via Phabricator, <
> reviews at reviews.llvm.org> wrote:
>
>> hubert.reinterpretcast added a comment.
>>
>> In D65667#1643305 <https://reviews.llvm.org/D65667#1643305>, @EricWF
>> wrote:
>>
>> > That doesn't need to happen now. But I want to see these changed to be
>> global statics not function local. At least that way we omit the guards
>> entirely. and accessing the variable becomes a single instruction.
>>
>>
>> This goes back to the "paying for something you don't use" with regards
>> to the up-front library loading cost. If people are actually agreed on this
>> course of action, then we can create that version of the patch, but it does
>> not seem clear to me.
>>
>>
>> CHANGES SINCE LAST ACTION
>>   https://reviews.llvm.org/D65667/new/
>>
>> https://reviews.llvm.org/D65667
>>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190823/7da23270/attachment.html>


More information about the libcxx-commits mailing list