Test fixes and review feedback

This commit is contained in:
Alejandro Alonso
2025-01-09 15:54:54 -08:00
parent f76d841540
commit cedea94b4c
9 changed files with 58 additions and 42 deletions

View File

@@ -1123,27 +1123,28 @@ public:
};
class BuiltinFixedArrayTypeRef final : public TypeRef {
intptr_t Size;
const TypeRef *Size;
const TypeRef *Element;
static TypeRefID Profile(const intptr_t &Size, const TypeRef *Element) {
static TypeRefID Profile(const TypeRef *Size, const TypeRef *Element) {
TypeRefID ID;
ID.addInteger((uint64_t)Size);
ID.addPointer(Size);
ID.addPointer(Element);
return ID;
}
public:
BuiltinFixedArrayTypeRef(const intptr_t &Size, const TypeRef *Element)
BuiltinFixedArrayTypeRef(const TypeRef *Size, const TypeRef *Element)
: TypeRef(TypeRefKind::BuiltinFixedArray), Size(Size), Element(Element) {}
template <typename Allocator>
static const BuiltinFixedArrayTypeRef *create(Allocator &A, intptr_t Size,
static const BuiltinFixedArrayTypeRef *create(Allocator &A,
const TypeRef *Size,
const TypeRef *Element) {
FIND_OR_CREATE_TYPEREF(A, BuiltinFixedArrayTypeRef, Size, Element);
}
const intptr_t &getSize() const {
const TypeRef *getSizeType() const {
return Size;
}

View File

@@ -938,9 +938,7 @@ public:
const TypeRef *createBuiltinFixedArrayType(const TypeRef *size,
const TypeRef *element) {
auto integer = cast<IntegerTypeRef>(size);
return BuiltinFixedArrayTypeRef::create(*this, integer->getValue(),
element);
return BuiltinFixedArrayTypeRef::create(*this, size, element);
}
// Construct a bound generic type ref along with the parent type info