Add array size deduction from tuple(fix#1590) (#2825)

Allow array size deduction from tuples and arrays on array declaration

Closes #1590
This commit is contained in:
kshokhin
2023-05-22 11:36:29 -07:00
committed by GitHub
parent 8ad08e34e2
commit 40b3518d37
21 changed files with 341 additions and 53 deletions
+5 -2
View File
@@ -703,8 +703,11 @@ void Value::Print(llvm::raw_ostream& out) const {
}
case Value::Kind::StaticArrayType: {
const auto& array_type = cast<StaticArrayType>(*this);
out << "[" << array_type.element_type() << "; " << array_type.size()
<< "]";
out << "[" << array_type.element_type() << ";";
if (array_type.has_size()) {
out << " " << array_type.size();
}
out << "]";
break;
}
}