diff options
author | hexcoder- <heiko@hexco.de> | 2020-03-27 21:03:28 +0100 |
---|---|---|
committer | hexcoder- <heiko@hexco.de> | 2020-03-27 21:03:28 +0100 |
commit | 7c76b7db04b7068c3b52f3a0eeaf19d468425e79 (patch) | |
tree | 7c5cda997509f7ce65bf7a8505f8bcafc7b9bdef /llvm_mode/afl-llvm-pass.so.cc | |
parent | a7553eae289ccaeb9626c650fa503ed04475c4f5 (diff) | |
download | afl++-7c76b7db04b7068c3b52f3a0eeaf19d468425e79.tar.gz |
part1 make it compilable for llvm 3.8.0 (ubuntu 16.04)
Diffstat (limited to 'llvm_mode/afl-llvm-pass.so.cc')
-rw-r--r-- | llvm_mode/afl-llvm-pass.so.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm_mode/afl-llvm-pass.so.cc b/llvm_mode/afl-llvm-pass.so.cc index e8f449b1..1c0a3c93 100644 --- a/llvm_mode/afl-llvm-pass.so.cc +++ b/llvm_mode/afl-llvm-pass.so.cc @@ -131,6 +131,20 @@ class AFLCoverage : public ModulePass { char AFLCoverage::ID = 0; +/* needed up to 3.9.0 */ +#if LLVM_VERSION_MAJOR == 3 && (LLVM_VERSION_MINOR < 9 || (LLVM_VERSION_MINOR == 9 && LLVM_VERSION_PATCH < 1)) +uint64_t PowerOf2Ceil(unsigned in) { + uint64_t in64 = in - 1; + in64 |= (in64 >> 1); + in64 |= (in64 >> 2); + in64 |= (in64 >> 4); + in64 |= (in64 >> 8); + in64 |= (in64 >> 16); + in64 |= (in64 >> 32); + return in64 + 1; +} +#endif + bool AFLCoverage::runOnModule(Module &M) { LLVMContext &C = M.getContext(); |