1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/lib/TableGen
Benjamin Kramer 0e31955b32 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: 238602
2015-05-29 19:43:39 +00:00
..
CMakeLists.txt
Error.cpp Fix tablegen's PrintFatalError function to run registered file 2015-05-11 22:17:13 +00:00
LLVMBuild.txt
Main.cpp [TableGen] Include header for each cpp file first. NFC 2015-05-26 06:48:46 +00:00
Makefile
module.modulemap
Record.cpp [TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit as they weren't able to be called. 2015-05-29 05:51:32 +00:00
SetTheory.cpp [TableGen] Include header for each cpp file first. NFC 2015-05-26 06:48:46 +00:00
StringMatcher.cpp
TableGenBackend.cpp [TableGen] Fix line wrapping logic for the autogenerated header to use math that makes more sense (at least to me). 2015-05-26 08:07:56 +00:00
TGLexer.cpp
TGLexer.h Remove empty non-virtual destructors or mark them =default when non-public 2015-04-11 15:32:26 +00:00
TGParser.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
TGParser.h [TableGen] Resolve complex def names inside multiclasses 2015-05-21 04:32:56 +00:00