[PATCH] D22834: Added 'inline' attribute to basic_string's destructor

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 2 22:47:09 PDT 2016


On Mon, Aug 1, 2016 at 2:20 PM, David Blaikie via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

>
>
> On Tue, Jul 26, 2016 at 4:37 PM Laxman Sole via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> laxmansole created this revision.
>> laxmansole added reviewers: mclow.lists, howard.hinnant.
>> laxmansole added subscribers: cfe-commits, sebpop, hiraditya, evandro,
>> flyingforyou.
>>
>>
>> Currently basic_string's destructor is not getting inlined. So adding
>> 'inline' attribute to ~basic_string().
>>
>
> 'inline' just gives the compiler a little extra push to try to inline - it
> shouldn't really be needed (the compiler's heuristics should make the right
> choices). Have you looked to see if there's a bug in the optimizer that
> should be fixed instead?
>


The destructor is externally instantiated so this change is needed to allow
Clang to generate inline calls to it.


>
>
>>
>>
>> Worked in collaboration with Aditya Kumar.
>>
>> https://reviews.llvm.org/D22834
>>
>> Files:
>>   libcxx/include/string
>>
>> Index: libcxx/include/string
>> ===================================================================
>> --- libcxx/include/string
>> +++ libcxx/include/string
>> @@ -2350,6 +2350,7 @@
>>  #endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
>>
>>  template <class _CharT, class _Traits, class _Allocator>
>> +inline _LIBCPP_INLINE_VISIBILITY
>>  basic_string<_CharT, _Traits, _Allocator>::~basic_string()
>>  {
>>  #if _LIBCPP_DEBUG_LEVEL >= 2
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160802/a7bd9e11/attachment.html>


More information about the cfe-commits mailing list