@@ -58,16 +58,19 @@ bool Type::isIntegerTy(unsigned Bitwidth) const {
5858 return isIntegerTy () && cast<IntegerType>(this )->getBitWidth () == Bitwidth;
5959}
6060
61- bool Type::isScalableTy () const {
61+ bool Type::isScalableTy (SmallPtrSetImpl<Type *> &Visited ) const {
6262 if (const auto *ATy = dyn_cast<ArrayType>(this ))
63- return ATy->getElementType ()->isScalableTy ();
64- if (const auto *STy = dyn_cast<StructType>(this )) {
65- SmallPtrSet<Type *, 4 > Visited;
66- return STy->isScalableTy (&Visited);
67- }
63+ return ATy->getElementType ()->isScalableTy (Visited);
64+ if (const auto *STy = dyn_cast<StructType>(this ))
65+ return STy->isScalableTy (Visited);
6866 return getTypeID () == ScalableVectorTyID || isScalableTargetExtTy ();
6967}
7068
69+ bool Type::isScalableTy () const {
70+ SmallPtrSet<Type *, 4 > Visited;
71+ return isScalableTy (Visited);
72+ }
73+
7174const fltSemantics &Type::getFltSemantics () const {
7275 switch (getTypeID ()) {
7376 case HalfTyID: return APFloat::IEEEhalf ();
@@ -394,14 +397,14 @@ StructType *StructType::get(LLVMContext &Context, ArrayRef<Type*> ETypes,
394397 return ST;
395398}
396399
397- bool StructType::isScalableTy (SmallPtrSetImpl<Type *> * Visited) const {
400+ bool StructType::isScalableTy (SmallPtrSetImpl<Type *> & Visited) const {
398401 if ((getSubclassData () & SCDB_ContainsScalableVector) != 0 )
399402 return true ;
400403
401404 if ((getSubclassData () & SCDB_NotContainsScalableVector) != 0 )
402405 return false ;
403406
404- if (Visited && !Visited-> insert (const_cast <StructType *>(this )).second )
407+ if (!Visited. insert (const_cast <StructType *>(this )).second )
405408 return false ;
406409
407410 for (Type *Ty : elements ()) {
0 commit comments