llvm-project/clang/utils
Benjamin Kramer 3204b152b5 Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.


Call sites were found with the ASTMatcher + some semi-automated cleanup.

memberCallExpr(
    argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
    on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
    hasArgument(0, bindTemporaryExpr(
                       hasType(recordDecl(hasNonTrivialDestructor())),
                       has(constructExpr()))),
    unless(isInTemplateInstantiation()))

No functional change intended.

llvm-svn: 238601
2015-05-29 19:42:19 +00:00
..
ABITest Fix invalid test generation by utils/ABITest/ABITestGen.py when the same enum is generated more than once. 2014-08-21 10:13:49 +00:00
CIndex
TableGen Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:42:19 +00:00
TestUtils
VtableTest
analyzer [analyzer] Rename NewDeleteLeaks checker in the test script. 2014-10-31 17:40:14 +00:00
check_cfc [utils] Add Check Compile Flow Consistency tool (check_cfc.py). 2015-04-02 15:01:53 +00:00
valgrind clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp: Add /usr/bin/cmp. 2013-01-20 15:30:41 +00:00
CaptureCmd
ClangDataFormat.py [utils/ClangDataFormat.py] Don't use lldb.frame directly, get the frame from the value. 2013-01-09 23:22:08 +00:00
CmpDriver utils/CmpDriver: add brief documentation to indicate what this does 2014-05-21 02:08:10 +00:00
FindSpecRefs
FuzzTest [utils/FuzzTest] Add '--stop-on-fail' to stop the script on the first failure 2012-03-08 20:29:39 +00:00
builtin-defines.c
clang-completion-mode.el Minor comments and changes to clang-completion-mode.el, from David Wood! 2012-06-07 22:33:29 +00:00
clang.natvis Add a Visualizer for VarDecl. 2014-06-26 16:26:42 +00:00
find-unused-diagnostics.sh Increase the portability of this script a bit: use /usr/bin/env to find bash, 2013-05-24 23:54:21 +00:00
token-delta.py