aboutsummaryrefslogtreecommitdiff
path: root/instrumentation/cmplog-instructions-pass.cc
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-11-03 13:18:02 +0100
committervanhauser-thc <vh@thc.org>2021-11-03 13:18:02 +0100
commit7a7630ae91c87e000b40f63c592fad9e09ad45d3 (patch)
tree1a8840fca5a92593079af9735f4b91443bc682e3 /instrumentation/cmplog-instructions-pass.cc
parentccded9fc5cfead1b88104484c4acde12e81e0afe (diff)
downloadAFLplusplus-7a7630ae91c87e000b40f63c592fad9e09ad45d3.tar.gz
support llvm >= 11
Diffstat (limited to 'instrumentation/cmplog-instructions-pass.cc')
-rw-r--r--instrumentation/cmplog-instructions-pass.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/instrumentation/cmplog-instructions-pass.cc b/instrumentation/cmplog-instructions-pass.cc
index cb149e9a..01a8a637 100644
--- a/instrumentation/cmplog-instructions-pass.cc
+++ b/instrumentation/cmplog-instructions-pass.cc
@@ -338,8 +338,10 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
}
+#if LLVM_MAJOR > 11
vector_cnt = tt->getElementCount().getFixedValue();
ty0 = tt->getElementType();
+#endif
}
@@ -357,9 +359,11 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
max_size = 80;
else if (ty0->isFP128Ty() || ty0->isPPC_FP128Ty())
max_size = 128;
+#if LLVM_MAJOR > 11
else if (ty0->getTypeID() != llvm::Type::PointerTyID && !be_quiet)
fprintf(stderr, "Warning: unsupported cmp type for cmplog: %u!\n",
ty0->getTypeID());
+#endif
attr += 8;
@@ -367,6 +371,7 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
if (ty0->isVectorTy()) {
+#if LLVM_MAJOR > 11
VectorType *tt = dyn_cast<VectorType>(ty0);
if (!tt) {
@@ -377,6 +382,7 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
vector_cnt = tt->getElementCount().getFixedValue();
ty1 = ty0 = tt->getElementType();
+#endif
}
@@ -391,13 +397,16 @@ bool CmpLogInstructions::hookInstrs(Module &M) {
} else {
+#if LLVM_MAJOR > 11
if (ty0->getTypeID() != llvm::Type::PointerTyID && !be_quiet) {
- fprintf(stderr, "Warning: unsupported cmp type for cmplog: %u!\n",
+ fprintf(stderr, "Warning: unsupported cmp type for cmplog: %u\n",
ty0->getTypeID());
}
+#endif
+
}
}