<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in libcxx_move_hack.cpp</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>72315d02 - Treat `std::move`, `forward`, etc. as builtins.</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/clang/test/SemaCXX/libcxx_move_hack.cpp#72315d02</link>
        <description>Treat `std::move`, `forward`, etc. as builtins.This is extended to all `std::` functions that take a reference to avalue and return a reference (or pointer) to that same value: `move`,`forward`, `move_if_noexcept`, `as_const`, `addressof`, and thelibstdc++-specific function `__addressof`.We still require these functions to be declared before they can be used,but don&apos;t instantiate their definitions unless their addresses aretaken. Instead, code generation, constant evaluation, and staticanalysis are given direct knowledge of their effect.This change aims to reduce various costs associated with these functions-- per-instantiation memory costs, compile time and memory costs due tocreating out-of-line copies and inlining them, code size at -O0, and soon -- so that they are not substantially more expensive than a cast.Most of these improvements are very small, but I measured a 3% decreasein -O0 object file size for a simple C++ source file using the standardlibrary after this change.We now automatically infer the `const` and `nothrow` attributes on thesenow-builtin functions, in particular meaning that we get a warning foran unused call to one of these functions.In C++20 onwards, we disallow taking the addresses of these functions,per the C++20 &quot;addressable function&quot; rule. In earlier language modes, acompatibility warning is produced but the address can still be taken.The same infrastructure is extended to the existing MSVC builtin`__GetExceptionInfo`, which is now only recognized in namespace `std`like it always should have been.This is a re-commit of  fc3090109643af8d2da9822d0f99c84742b9c877,  a571f82a50416b767fd3cce0fb5027bb5dfec58c,  64c045e25b8471bbb572bd29159c294a82a86a2, and  de6ddaeef3aaa8a9ae3663c12cdb57d9afc0f906,and reverts aa643f455a5362de7189eac630050d2c8aefe8f2.This change also includes a workaround for users using libc++ 3.1 andearlier (!!), as apparently happens on AIX, where std::move sometimesreturns by value.Reviewed By: aaron.ballmanDifferential Revision: https://reviews.llvm.org/D123345Revert &quot;Fixup D123950 to address revert of D123345&quot;This reverts commit aa643f455a5362de7189eac630050d2c8aefe8f2.

            List of files:
            /llvm-project-15.0.7/clang/test/SemaCXX/libcxx_move_hack.cpp</description>
        <pubDate>Thu, 21 Apr 2022 00:13:56 +0000</pubDate>
        <dc:creator>Richard Smith &lt;richard@metafoo.co.uk&gt;</dc:creator>
    </item>
</channel>
</rss>
