llvm-project/llvm/lib/TableGen
Benjamin Kramer f5e2fc474d 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 Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
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
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
TGLexer.cpp Change TableGen so that binary literals such as 0b001 are now sized. 2014-08-07 05:47:00 +00:00
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
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
module.modulemap [modules] Add module maps for LLVM. These are not quite ready for prime-time 2014-05-21 02:46:14 +00:00