vector<Branch> branches;
if(type.base_type)
- branches.push_back(format("%s: %%%d %s", (type.kind==BasicTypeDeclaration::ALIAS ? "Alias of" : "Base"), get_label(*type.base_type), type.base_type->name));
+ branches.emplace_back(format("%s: %%%d %s", (type.kind==BasicTypeDeclaration::ALIAS ? "Alias of" : "Base"), get_label(*type.base_type), type.base_type->name));
if(type.kind==BasicTypeDeclaration::VECTOR)
- branches.push_back(format("Vector: %d", type.size));
+ branches.emplace_back(format("Vector: %d", type.size));
else if(type.kind==BasicTypeDeclaration::MATRIX)
- branches.push_back(format("Matrix: %dx%d", type.size&0xFFFF, type.size>>16));
+ branches.emplace_back(format("Matrix: %dx%d", type.size&0xFFFF, type.size>>16));
append_subtree(branches);
}
append(type, format("%%%d typedef %s", get_label(type), type.name));
vector<Branch> branches;
- branches.push_back(format("Dimensions: %s%s", dims[type.dimensions-1], (type.array ? " array" : "")));
+ branches.emplace_back(format("Dimensions: %s%s", dims[type.dimensions-1], (type.array ? " array" : "")));
if(type.base_type)
- branches.push_back(format("Element type: %%%d %s", get_label(*type.base_type), type.base_type->name));
+ branches.emplace_back(format("Element type: %%%d %s", get_label(*type.base_type), type.base_type->name));
if(type.shadow)
- branches.push_back("Shadow");
+ branches.emplace_back("Shadow");
append_subtree(branches);
}
if(var.array)
{
if(var.array_size)
- branches.push_back(Branch("Array []", var.array_size.get()));
+ branches.emplace_back("Array []", var.array_size.get());
else
branches.push_back("Array []");
}
append(cond, "if()");
vector<Branch> branches;
- branches.push_back(cond.condition.get());
- branches.push_back(Branch("then", &cond.body));
+ branches.emplace_back(cond.condition.get());
+ branches.emplace_back("then", &cond.body);
if(!cond.else_body.body.empty())
- branches.push_back(Branch("else", &cond.else_body));
+ branches.emplace_back("else", &cond.else_body);
append_subtree(branches);
}
vector<Branch> branches;
if(iter.init_statement)
- branches.push_back(Branch("Initialization", iter.init_statement.get()));
+ branches.emplace_back("Initialization", iter.init_statement.get());
if(iter.condition)
- branches.push_back(Branch("Condition", iter.condition.get()));
+ branches.emplace_back("Condition", iter.condition.get());
if(iter.loop_expression)
- branches.push_back(Branch("Loop", iter.loop_expression.get()));
- branches.push_back(&iter.body);
+ branches.emplace_back("Loop", iter.loop_expression.get());
+ branches.emplace_back(&iter.body);
append_subtree(branches);
}