15const std::vector<std::unique_ptr<AggregateType>>&
17 return Get().aggregate_types_;
21const std::vector<std::unique_ptr<BitFieldStructType>>&
23 return Get().bit_field_struct_types_;
30 auto& p =
Get().aggregate_types_[current++];
40 if (params.size() != arg_types.size()) {
41 ReportError(
"Generic struct takes ", params.size(),
" parameters, but ",
42 arg_types.size(),
" were given");
46 return *specialization;
48 const Type* type =
nullptr;
54 CurrentScope::Scope generic_scope(generic_type->
ParentScope());
56 {{generic_type, arg_types}},
65Namespace* TypeOracle::CreateGenericTypeInstantiationNamespace() {
66 Get().generic_type_instantiation_namespaces_.push_back(
67 std::make_unique<Namespace>(GENERIC_TYPE_INSTANTIATION_NAMESPACE_STRING));
68 return Get().generic_type_instantiation_namespaces_.back().get();
72std::vector<const ClassType*> TypeOracle::GetClasses() {
73 std::vector<const ClassType*>
result;
74 for (
const std::unique_ptr<AggregateType>& t :
Get().aggregate_types_) {
75 if (
auto* class_type = ClassType::DynamicCast(t.get())) {
82std::optional<const Type*> TypeOracle::MatchReferenceGeneric(
83 const Type* reference_type,
bool* is_const) {
84 if (
auto type = Type::MatchUnaryGeneric(reference_type,
85 GetMutableReferenceGeneric())) {
86 if (is_const) *is_const =
false;
90 Type::MatchUnaryGeneric(reference_type, GetConstReferenceGeneric())) {
91 if (is_const) *is_const =
true;
void push_back(const T &value)
Scope * ParentScope() const
void AddSpecialization(const TypeVector &type_arguments, SpecializationType specialization)
std::optional< SpecializationType > GetSpecialization(const TypeVector &type_arguments) const
const GenericParameters & generic_parameters() const
std::vector< std::unique_ptr< AggregateType > > aggregate_types_
static const std::vector< std::unique_ptr< AggregateType > > & GetAggregateTypes()
static const Type * GetGenericTypeInstance(GenericType *generic_type, TypeVector arg_types)
static void FinalizeAggregateTypes()
static const std::vector< std::unique_ptr< BitFieldStructType > > & GetBitFieldStructTypes()
static const Type * ComputeType(TypeExpression *type_expression)
ZoneVector< RpoNumber > & result
V8_INLINE const Operation & Get(const Graph &graph, OpIndex index)
void ReportError(Args &&... args)
std::vector< const Type * > TypeVector