Don't use deprecated llvm::Type::getVectorNumElements() Use llvm::VectorType::getNumElements() instead by casting to the expected subtype. Bug: b/152339534 Change-Id: I29d2b8d60872f6f4eff4ae2bb38d1738515d11dc Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/44068 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Tested-by: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/Reactor/LLVMReactor.cpp b/src/Reactor/LLVMReactor.cpp index 6e184b8..82e5cdc 100644 --- a/src/Reactor/LLVMReactor.cpp +++ b/src/Reactor/LLVMReactor.cpp
@@ -420,7 +420,7 @@ ASSERT(offsets->getType()->isVectorTy()); ASSERT(mask->getType()->isVectorTy()); - auto numEls = mask->getType()->getVectorNumElements(); + auto numEls = llvm::cast<llvm::VectorType>(mask->getType())->getNumElements(); auto i1Ty = ::llvm::Type::getInt1Ty(jit->context); auto i32Ty = ::llvm::Type::getInt32Ty(jit->context); auto i8Ty = ::llvm::Type::getInt8Ty(jit->context); @@ -445,13 +445,13 @@ ASSERT(offsets->getType()->isVectorTy()); ASSERT(mask->getType()->isVectorTy()); - auto numEls = mask->getType()->getVectorNumElements(); + auto numEls = llvm::cast<llvm::VectorType>(mask->getType())->getNumElements(); auto i1Ty = ::llvm::Type::getInt1Ty(jit->context); auto i32Ty = ::llvm::Type::getInt32Ty(jit->context); auto i8Ty = ::llvm::Type::getInt8Ty(jit->context); auto i8PtrTy = i8Ty->getPointerTo(); auto elVecTy = val->getType(); - auto elTy = elVecTy->getVectorElementType(); + auto elTy = llvm::cast<llvm::VectorType>(elVecTy)->getElementType(); auto elPtrTy = elTy->getPointerTo(); auto elPtrVecTy = ::llvm::VectorType::get(elPtrTy, numEls); auto i8Base = jit->builder->CreatePointerCast(base, i8PtrTy); @@ -1133,7 +1133,7 @@ ASSERT(V(ptr)->getType()->isPointerTy()); ASSERT(V(mask)->getType()->isVectorTy()); - auto numEls = V(mask)->getType()->getVectorNumElements(); + auto numEls = llvm::cast<llvm::VectorType>(V(mask)->getType())->getNumElements(); auto i1Ty = ::llvm::Type::getInt1Ty(jit->context); auto i32Ty = ::llvm::Type::getInt32Ty(jit->context); auto elVecTy = ::llvm::VectorType::get(T(elTy), numEls); @@ -1153,7 +1153,7 @@ ASSERT(V(val)->getType()->isVectorTy()); ASSERT(V(mask)->getType()->isVectorTy()); - auto numEls = V(mask)->getType()->getVectorNumElements(); + auto numEls = llvm::cast<llvm::VectorType>(V(mask)->getType())->getNumElements(); auto i1Ty = ::llvm::Type::getInt1Ty(jit->context); auto i32Ty = ::llvm::Type::getInt32Ty(jit->context); auto elVecTy = V(val)->getType();