about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorLukas Zaoral <lzaoral@redhat.com>2021-03-04 15:02:57 +0100
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2021-09-10 15:14:56 +0100
commit8ac323db7d367799fba9435b64fe715c603e60ba (patch)
tree1214378eaf9cc2907b4acac074e3c5d4a3e4cb7c /lib
parentdf04aeadefb4e1c34c7ef8b9123947ff045a34d9 (diff)
downloadklee-8ac323db7d367799fba9435b64fe715c603e60ba.tar.gz
llvm12: VectorType::getNumElements() has been deprecated
... and has already been removed from the LLVM 13 source tree.

See:
https://reviews.llvm.org/D78127
https://reviews.llvm.org/D95570
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/Executor.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp
index a81c4882..aaa56a55 100644
--- a/lib/Core/Executor.cpp
+++ b/lib/Core/Executor.cpp
@@ -3137,7 +3137,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
       return;
     }
     uint64_t iIdx = cIdx->getZExtValue();
+#if LLVM_VERSION_MAJOR >= 11
+    const auto *vt = cast<llvm::FixedVectorType>(iei->getType());
+#else
     const llvm::VectorType *vt = iei->getType();
+#endif
     unsigned EltBits = getWidthForLLVMType(vt->getElementType());
 
     if (iIdx >= vt->getNumElements()) {
@@ -3175,7 +3179,11 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) {
       return;
     }
     uint64_t iIdx = cIdx->getZExtValue();
+#if LLVM_VERSION_MAJOR >= 11
+    const auto *vt = cast<llvm::FixedVectorType>(eei->getVectorOperandType());
+#else
     const llvm::VectorType *vt = eei->getVectorOperandType();
+#endif
     unsigned EltBits = getWidthForLLVMType(vt->getElementType());
 
     if (iIdx >= vt->getNumElements()) {