@@ -444,6 +444,17 @@ class VectorType : public Type {
444
444
// / This static method is the primary way to construct an VectorType.
445
445
static VectorType *get (Type *ElementType, ElementCount EC);
446
446
447
+ // / Base class getter that specifically constructs a FixedVectorType. This
448
+ // / function is deprecated, and will be removed after LLVM 11 ships. Since
449
+ // / this always returns a FixedVectorType via a base VectorType pointer,
450
+ // / FixedVectorType::get(Type *, unsigned) is strictly better since no cast is
451
+ // / required to call getNumElements() on the result.
452
+ LLVM_ATTRIBUTE_DEPRECATED (
453
+ inline static VectorType *get (Type *ElementType, unsigned NumElements),
454
+ "The base class version of get with the scalable argument defaulted to "
455
+ "false is deprecated. Either call VectorType::get(Type *, unsigned , "
456
+ " bool ) and pass false, or call FixedVectorType::get(Type *, unsigned ).");
457
+
447
458
static VectorType *get (Type *ElementType, unsigned NumElements,
448
459
bool Scalable) {
449
460
return VectorType::get (ElementType, {NumElements, Scalable});
@@ -538,6 +549,10 @@ class VectorType : public Type {
538
549
}
539
550
};
540
551
552
+ inline VectorType *VectorType::get (Type *ElementType, unsigned NumElements) {
553
+ return VectorType::get (ElementType, NumElements, false );
554
+ }
555
+
541
556
// / Class to represent fixed width SIMD vectors
542
557
class FixedVectorType : public VectorType {
543
558
protected:
0 commit comments