llvm/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 Introduce bitset metadata format and bitset lowering pass. 2015-02-20 20:30:47 +00:00
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 Reformat partially, where I touched for whitespace changes. 2014-10-28 11:54:52 +00:00
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 [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
Inliner.cpp [Inliner] Discard empty COMDAT groups 2015-05-05 20:14:22 +00:00
InlineSimple.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
Internalize.cpp Use range based for loops to avoid needing to re-mention SmallPtrSet size. 2014-08-24 23:23:06 +00:00
IPConstantPropagation.cpp
IPO.cpp Introduce bitset metadata format and bitset lowering pass. 2015-02-20 20:30:47 +00:00
LLVMBuild.txt Update libdeps since TLI was moved from Target to Analysis in r226078. 2015-01-15 05:21:00 +00:00
LoopExtractor.cpp [PM] Lift the analyses into the interface for 2015-01-19 03:03:39 +00:00
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 Add range adapters predecessors() and successors() for BBs 2015-02-04 19:14:57 +00:00
PassManagerBuilder.cpp Remove the InstructionSimplifierPass immediately after InstructionCombiningPass. 2015-05-19 16:09:11 +00:00
PruneEH.cpp Don't promote asynch EH invokes of nounwind functions to calls 2015-02-11 01:23:16 +00:00
StripDeadPrototypes.cpp
StripSymbols.cpp IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00