diff options
author | van Hauser <vh@thc.org> | 2020-04-25 17:53:38 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-04-25 17:53:38 +0200 |
commit | 0c3d06c41e2848f53db5caa881d624df87cec0d2 (patch) | |
tree | e91f65c47afe18e9c78f2b603ed59342fc191e64 /llvm_mode/afl-llvm-lto-instrumentation.so.cc | |
parent | 07db922024a1faf5543f9d83ce683024e99526ce (diff) | |
download | afl++-0c3d06c41e2848f53db5caa881d624df87cec0d2.tar.gz |
refactored whitelist and blacklist in llvm_mode
Diffstat (limited to 'llvm_mode/afl-llvm-lto-instrumentation.so.cc')
-rw-r--r-- | llvm_mode/afl-llvm-lto-instrumentation.so.cc | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/llvm_mode/afl-llvm-lto-instrumentation.so.cc b/llvm_mode/afl-llvm-lto-instrumentation.so.cc index eefac629..118ada52 100644 --- a/llvm_mode/afl-llvm-lto-instrumentation.so.cc +++ b/llvm_mode/afl-llvm-lto-instrumentation.so.cc @@ -57,6 +57,7 @@ #include "llvm/Pass.h" #include <set> +#include "afl-llvm-common.h" using namespace llvm; @@ -104,52 +105,6 @@ class AFLLTOPass : public ModulePass { } - // Get the internal llvm name of a basic block - // This is an ugly debug support so it is commented out :-) - /* - static char *getBBName(const BasicBlock *BB) { - - static char *name; - - if (!BB->getName().empty()) { - - name = strdup(BB->getName().str().c_str()); - return name; - - } - - std::string Str; - raw_string_ostream OS(Str); - - BB->printAsOperand(OS, false); - - name = strdup(OS.str().c_str()); - - return name; - - } - - */ - - static bool isBlacklisted(const Function *F) { - - static const char *Blacklist[] = { - - "asan.", "llvm.", "sancov.", "__ubsan_handle_", "ign.", "__afl_", - "_fini", "__libc_csu", "__asan", "__msan", "msan." - - }; - - for (auto const &BlacklistFunc : Blacklist) { - - if (F->getName().startswith(BlacklistFunc)) { return true; } - - } - - return false; - - } - bool runOnModule(Module &M) override; protected: |