hanchenye-llvm-project/clang/lib/ARCMigrate
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
..
ARCMT.cpp Switch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in order to preserve full information on module macro expansion. 2015-05-04 03:15:40 +00:00
ARCMTActions.cpp
CMakeLists.txt Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00
FileRemapper.cpp Use the simpler version of llvm::sys::fs::exists. 2014-09-11 18:10:13 +00:00
Internals.h Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 06:28:36 +00:00
Makefile
ObjCMT.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:42:19 +00:00
PlistReporter.cpp Fix layering violation: include/clang/Basic/PlistSupport.h should not include 2015-01-28 20:14:54 +00:00
TransAPIUses.cpp [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00
TransARCAssign.cpp
TransAutoreleasePool.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransBlockObjCVariable.cpp [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. 2014-03-14 18:34:04 +00:00
TransEmptyStatementsAndDealloc.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransGCAttrs.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransGCCalls.cpp Get ARCMT/GC-check-warn-nsalloc.m working 2014-05-19 22:51:11 +00:00
TransProperties.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransProtectedScope.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransRetainReleaseDealloc.cpp [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00
TransUnbridgedCasts.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransUnusedInitDelegate.cpp [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00
TransZeroOutPropsInDealloc.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
TransformActions.cpp Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue. 2014-11-19 03:06:06 +00:00
Transforms.cpp [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00
Transforms.h [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00