llvm-project/clang/lib/Serialization
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
..
ASTCommon.cpp Replace Sema's map of locally-scoped extern "C" declarations with a DeclContext 2015-03-07 00:04:49 +00:00
ASTCommon.h [modules] If we reach a definition of a class for which we already have a 2015-03-26 04:09:53 +00:00
ASTReader.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:42:19 +00:00
ASTReaderDecl.cpp Allow skipping imports in the module visitor. 2015-05-20 10:29:23 +00:00
ASTReaderInternals.h Objective-C: Serialize "more than one decl" state of ObjCMethodList. 2014-12-27 22:14:15 +00:00
ASTReaderStmt.cpp [OPENMP] Fixed support for 'schedule' clause with non-constant chunk size. 2015-05-12 08:35:28 +00:00
ASTWriter.cpp Refactor MacroInfo so macro arguments can be iterated with range-based for loops. 2015-05-29 09:15:24 +00:00
ASTWriterDecl.cpp [AST] Put VarDeclBitfields on a diet 2015-05-19 00:57:16 +00:00
ASTWriterStmt.cpp [OPENMP] Fixed support for 'schedule' clause with non-constant chunk size. 2015-05-12 08:35:28 +00:00
CMakeLists.txt Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
GeneratePCH.cpp Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
GlobalModuleIndex.cpp Remove many superfluous SmallString::str() calls. 2015-03-18 10:17:07 +00:00
Makefile
Module.cpp [modules] Deserialize CXXCtorInitializer list for a constructor lazily. 2015-03-24 06:36:48 +00:00
ModuleManager.cpp Allow skipping imports in the module visitor. 2015-05-20 10:29:23 +00:00