support current llvm12 changes
MODIFY
docs/Changelog.md
docs/Changelog.md
@@ -10,6 +10,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
### Version ++2.67d (develop)
+ - Further llvm 12 support (fast moving target like afl++ :-) )
- Fix for auto dictionary not to throw out a -x dictionary

MODIFY
llvm_mode/LLVMInsTrim.so.cc
llvm_mode/LLVMInsTrim.so.cc
@@ -181,10 +181,16 @@ struct InsTrim : public ModulePass {
#ifdef AFL_HAVE_VECTOR_INTRINSICS
// IntegerType *Int64Ty = IntegerType::getInt64Ty(C);
- uint64_t PrevLocVecSize = PowerOf2Ceil(PrevLocSize);
+ int PrevLocVecSize = PowerOf2Ceil(PrevLocSize);
IntegerType *IntLocTy =
IntegerType::getIntNTy(C, sizeof(PREV_LOC_T) * CHAR_BIT);
- if (ngram_size) PrevLocTy = VectorType::get(IntLocTy, PrevLocVecSize);
+ if (ngram_size)
+ PrevLocTy = VectorType::get(IntLocTy, PrevLocVecSize
+ #if LLVM_VERSION_MAJOR >= 12
+ ,
+ false
+ #endif
+ );
#endif
/* Get globals for the SHM region and the previous location. Note that

MODIFY
llvm_mode/afl-clang-fast.c
llvm_mode/afl-clang-fast.c
@@ -978,8 +978,11 @@ int main(int argc, char **argv, char **envp) {
"AFL_DONT_OPTIMIZE: disable optimization instead of -O3\n"
"AFL_HARDEN: adds code hardening to catch memory bugs\n"
"AFL_INST_RATIO: percentage of branches to instrument\n"
+#if LLVM_VERSION_MAJOR < 9
"AFL_LLVM_NOT_ZERO: use cycling trace counters that skip zero\n"
+#else
"AFL_LLVM_SKIP_NEVERZERO: do not skip zero on trace counters\n"
+#endif
"AFL_LLVM_LAF_SPLIT_COMPARES: enable cascaded comparisons\n"
"AFL_LLVM_LAF_SPLIT_COMPARES_BITW: size limit (default 8)\n"
"AFL_LLVM_LAF_SPLIT_SWITCHES: casc. comp. in 'switch'\n"

MODIFY
llvm_mode/afl-llvm-pass.so.cc
llvm_mode/afl-llvm-pass.so.cc
@@ -225,8 +225,14 @@ bool AFLCoverage::runOnModule(Module &M) {
PrevLocSize = 1;
#ifdef AFL_HAVE_VECTOR_INTRINSICS
- uint64_t PrevLocVecSize = PowerOf2Ceil(PrevLocSize);
- if (ngram_size) PrevLocTy = VectorType::get(IntLocTy, PrevLocVecSize);
+ int PrevLocVecSize = PowerOf2Ceil(PrevLocSize);
+ if (ngram_size)
+ PrevLocTy = VectorType::get(IntLocTy, PrevLocVecSize
+ #if LLVM_VERSION_MAJOR >= 12
+ ,
+ false
+ #endif
+ );
#endif
/* Get globals for the SHM region and the previous location. Note that

support current llvm12 changes