llvm-6502/lib/Transforms/IPO
Benjamin Kramer 9589ff8949 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238602 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 19:43:39 +00:00
..
ArgumentPromotion.cpp Don't call utostr in Twine/raw_ostream contexts. 2015-05-28 11:24:24 +00:00
BarrierNoopPass.cpp
CMakeLists.txt
ConstantMerge.cpp DataLayout is mandatory, update the API to reflect it with references. 2015-03-10 02:37:25 +00:00
DeadArgumentElimination.cpp Change typeIncompatible to return an AttrBuilder instead of new-ing an AttributeSet. 2015-05-06 23:19:56 +00:00
ExtractGV.cpp
FunctionAttrs.cpp Remove conflicting attributes before adding deduced readonly/readnone 2015-05-25 19:46:38 +00:00
GlobalDCE.cpp GlobalDCE: Improve performance for large modules containing comdats. 2015-03-19 18:23:29 +00:00
GlobalOpt.cpp Recommit r236670: [opaque pointer type] Pass explicit pointer type through GEP constant folding"" 2015-05-07 17:28:58 +00:00
InlineAlways.cpp
Inliner.cpp [Inliner] Discard empty COMDAT groups 2015-05-05 20:14:22 +00:00
InlineSimple.cpp
Internalize.cpp
IPConstantPropagation.cpp
IPO.cpp
LLVMBuild.txt
LoopExtractor.cpp
LowerBitSets.cpp [opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposing it into pointee type + address space 2015-04-29 21:22:39 +00:00
Makefile
MergeFunctions.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
PartialInlining.cpp
PassManagerBuilder.cpp Remove the InstructionSimplifierPass immediately after InstructionCombiningPass. 2015-05-19 16:09:11 +00:00
PruneEH.cpp
StripDeadPrototypes.cpp
StripSymbols.cpp IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00