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

Aditya Kumar via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 7 15:10:00 PST 2016


hiraditya added a comment.

In https://reviews.llvm.org/D25624#582756, @mehdi_amini wrote:

> In https://reviews.llvm.org/D25624#582752, @mehdi_amini wrote:
>
> > (The commit message is confusing, it mentions "Currently basic_string's destructor is not getting inlined. So adding 'inline' attribute to ~basic_string()", please add the quote of the standard and mention that it enables instantiation)
>
>
> (i.e. "inline" does not cause directly "inlining" here, this comes as a side effect of just starting to emit it)


You are right. The problem was that the function definition wasn't getting generated in the translation unit as a result the inliner cannot inline. For some reason clang does not generate the definition of available_externally functions. Sorry for the confusion, this patch is sitting for a long time so I forgot about it. Just adding inline should also have the same effect. I can commit a separate patch with just the inline specifier if there is an agreement.


https://reviews.llvm.org/D25624





More information about the cfe-commits mailing list