@@ -13,28 +13,28 @@ IR::IR(std::string libName) : libName(std::move(libName)) {
1313
1414void IR::addFunction (std::string name, std::vector<Parameter> parameters,
1515 std::string retType, bool isVariadic) {
16- functions.push_back ( Function (std::move (name), std::move (parameters),
17- std::move (retType), isVariadic) );
16+ functions.emplace_back (std::move (name), std::move (parameters),
17+ std::move (retType), isVariadic);
1818}
1919
2020void IR::addTypeDef (std::string name, std::string type) {
21- typeDefs.push_back ( TypeDef ( std::move (name), std::move (type) ));
21+ typeDefs.emplace_back ( std::move (name), std::move (type));
2222}
2323
2424void IR::addEnum (std::string name, std::string type,
2525 std::vector<Enumerator> enumerators) {
26- enums.push_back (
27- Enum ( std::move (name), std::move (type), std::move (enumerators) ));
26+ enums.emplace_back ( std::move (name), std::move (type),
27+ std::move (enumerators));
2828}
2929
3030void IR::addStruct (std::string name, std::vector<Field> fields,
3131 uint64_t typeSize) {
32- structs.push_back ( Struct ( std::move (name), std::move (fields), typeSize) );
32+ structs.emplace_back ( std::move (name), std::move (fields), typeSize);
3333}
3434
3535void IR::addUnion (std::string name, std::vector<Field> fields,
3636 uint64_t maxSize) {
37- unions.push_back ( Union ( std::move (name), std::move (fields), maxSize) );
37+ unions.emplace_back ( std::move (name), std::move (fields), maxSize);
3838}
3939
4040bool IR::libObjEmpty () const {
0 commit comments