Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 658705710
  • Loading branch information
XLS Team authored and copybara-github committed Aug 2, 2024
1 parent ee7624e commit 6e4b953
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xls/ir/abstract_node_evaluator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ VB BuilderFromBoxedValue(LeafTypeTreeView<std::vector<BoxedBool>> input) {
}
if (input.type()->IsTuple()) {
std::vector<VB> elements;
elements.reserve(input.type()->AsTupleOrDie()->size());
for (int64_t i = 0; i < input.type()->AsTupleOrDie()->size(); ++i) {
elements.push_back(BuilderFromBoxedValue(input.AsView({i})));
}
return VB::TupleB(elements);
}
CHECK(input.type()->IsArray());
std::vector<VB> elements;
elements.reserve(input.type()->AsArrayOrDie()->size());
for (int64_t i = 0; i < input.type()->AsArrayOrDie()->size(); ++i) {
elements.push_back(BuilderFromBoxedValue(input.AsView({i})));
}
Expand Down
1 change: 1 addition & 0 deletions xls/ir/function_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ BValue BuilderBase::MatchTrue(absl::Span<const BValue> case_clauses,
loc);
}
std::vector<Case> cases;
cases.reserve(case_clauses.size());
for (int64_t i = 0; i < case_clauses.size(); ++i) {
cases.push_back(Case{case_clauses[i], case_values[i]});
}
Expand Down
1 change: 1 addition & 0 deletions xls/ir/value_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Value ValueOfType(Type* type,
}
case TypeKind::kArray: {
std::vector<Value> elements;
elements.reserve(type->AsArrayOrDie()->size());
for (int64_t i = 0; i < type->AsArrayOrDie()->size(); ++i) {
elements.push_back(
ValueOfType(type->AsArrayOrDie()->element_type(), fbits));
Expand Down

0 comments on commit 6e4b953

Please sign in to comment.