llvm-project/clang/lib/Tooling
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
..
Core Fix bug in Replacement's toString on Windows (missing flush). 2015-04-20 06:58:56 +00:00
ArgumentsAdjusters.cpp Attempt to fix the build with XCode 5.0.2 (and probably 5.1.1). 2015-01-16 15:57:15 +00:00
CMakeLists.txt Refactor libTooling to reduce required dependencies. 2014-10-29 18:55:09 +00:00
CommonOptionsParser.cpp [tooling] Move ArgumentsAdjustingCompilations into an anonymous namespace. 2015-03-23 12:47:15 +00:00
CompilationDatabase.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:42:19 +00:00
FileMatchTrie.cpp Tooling: Hide implementation details 2015-03-09 15:03:26 +00:00
JSONCompilationDatabase.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:42:19 +00:00
Makefile Refactor libTooling to reduce required dependencies. 2014-10-29 18:55:09 +00:00
Refactoring.cpp Refactor libTooling to reduce required dependencies. 2014-10-29 18:55:09 +00:00
RefactoringCallbacks.cpp Finishing the move of RefactoringCallbacks and fixing the corresponding 2012-07-17 08:37:03 +00:00
Tooling.cpp Make the clang-fuzzer use the CompilerInstance directly. 2015-03-28 00:42:36 +00:00