llvm-project/llvm
David Blaikie 0c4dbf9ecd Assigning to a local object in a return statement prevents copy elision. NFC.
I added a diagnostic along the lines of `-Wpessimizing-move` to detect `return x = y` suppressing copy elision, but I don't know if the diagnostic is really worth it. Anyway, here are the places where my diagnostic reported that copy elision would have been possible if not for the assignment.

P1155R1 in the post-San-Diego WG21 (C++ committee) mailing discusses whether WG21 should fix this pitfall by just changing the core language to permit copy elision in cases like these.

(Kona update: The bulk of P1155 is proceeding to CWG review, but specifically *not* the parts that explored the notion of permitting copy-elision in these specific cases.)

Reviewed By: dblaikie

Author: Arthur O'Dwyer

Differential Revision: https://reviews.llvm.org/D54885

llvm-svn: 359236
2019-04-25 20:09:00 +00:00
..
benchmarks
bindings [OCaml] Update api to account for FNeg and CallBr instructions 2019-04-16 15:00:19 +00:00
cmake [CMake] Use add_dependencies in add_llvm_install_targets 2019-04-23 21:59:07 +00:00
docs [Remarks] Fix documentation indentation 2019-04-24 00:27:59 +00:00
examples [JITLink] Update BuildingAJIT tutorials to account for API changes in r358818. 2019-04-20 17:35:28 +00:00
include Assigning to a local object in a return statement prevents copy elision. NFC. 2019-04-25 20:09:00 +00:00
lib Assigning to a local object in a return statement prevents copy elision. NFC. 2019-04-25 20:09:00 +00:00
projects
resources
runtimes [CMake] Replace the sanitizer support in runtimes build with multilib 2019-04-22 23:31:39 +00:00
test [GlobalISel][AArch64] Make G_EXTRACT_VECTOR_ELT legal for v8s16s 2019-04-25 20:00:57 +00:00
tools [yaml2obj] - Don't crash on invalid inputs. 2019-04-25 09:59:55 +00:00
unittests [Support] Add JSON streaming output API, faster where the heavy value types aren't needed. 2019-04-25 12:51:42 +00:00
utils gn build: Document llvm_enable_dia_sdk variable better 2019-04-25 14:56:56 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [CMake] Move configuration of LLVM_CXX_STD to HandleLLVMOptions.cmake 2019-04-09 08:14:32 +00:00
CODE_OWNERS.TXT
CREDITS.TXT add Qiu Chaofan (qiucf@cn.ibm.com) to the CREDITS.txt 2019-04-23 02:37:48 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.