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
CaptureCmd
ClangDataFormat.py
CmpDriver
FindSpecRefs
FuzzTest
builtin-defines.c
clang-completion-mode.el
clang.natvis
find-unused-diagnostics.sh
token-delta.py