@@ -13,28 +13,28 @@ IR::IR(std::string libName) : libName(std::move(libName)) {
13
13
14
14
void IR::addFunction (std::string name, std::vector<Parameter> parameters,
15
15
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);
18
18
}
19
19
20
20
void 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));
22
22
}
23
23
24
24
void IR::addEnum (std::string name, std::string type,
25
25
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));
28
28
}
29
29
30
30
void IR::addStruct (std::string name, std::vector<Field> fields,
31
31
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);
33
33
}
34
34
35
35
void IR::addUnion (std::string name, std::vector<Field> fields,
36
36
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);
38
38
}
39
39
40
40
bool IR::libObjEmpty () const {
0 commit comments