about summary refs log tree commit diff
path: root/instrumentation/afl-llvm-common.h
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-09-05 13:26:08 +0200
committerGitHub <noreply@github.com>2020-09-05 13:26:08 +0200
commit81b1d85f6168cb0828b4afef5d7994dba3c6753e (patch)
tree8ddfccbd1594c3f3c50025eb8cbe23f84a10fa20 /instrumentation/afl-llvm-common.h
parentfac108476c1cb5326cf4339b2a4c846828698816 (diff)
parent2f90f2faba92c0ef5e081ff74b54fb07eb1faaa9 (diff)
downloadafl++-81b1d85f6168cb0828b4afef5d7994dba3c6753e.tar.gz
Merge pull request #548 from AFLplusplus/pre-3
Pre 3.0 changes
Diffstat (limited to 'instrumentation/afl-llvm-common.h')
-rw-r--r--instrumentation/afl-llvm-common.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/instrumentation/afl-llvm-common.h b/instrumentation/afl-llvm-common.h
new file mode 100644
index 00000000..a1561d9c
--- /dev/null
+++ b/instrumentation/afl-llvm-common.h
@@ -0,0 +1,52 @@
+#ifndef __AFLLLVMCOMMON_H
+#define __AFLLLVMCOMMON_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <list>
+#include <string>
+#include <fstream>
+#include <sys/time.h>
+
+#include "llvm/Config/llvm-config.h"
+#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR < 5
+typedef long double max_align_t;
+#endif
+
+#include "llvm/IR/IRBuilder.h"
+#include "llvm/IR/LegacyPassManager.h"
+#include "llvm/IR/BasicBlock.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/MathExtras.h"
+#include "llvm/Transforms/IPO/PassManagerBuilder.h"
+
+#if LLVM_VERSION_MAJOR > 3 || \
+    (LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
+  #include "llvm/IR/DebugInfo.h"
+  #include "llvm/IR/CFG.h"
+#else
+  #include "llvm/DebugInfo.h"
+  #include "llvm/Support/CFG.h"
+#endif
+
+char *                 getBBName(const llvm::BasicBlock *BB);
+bool                   isIgnoreFunction(const llvm::Function *F);
+void                   initInstrumentList();
+bool                   isInInstrumentList(llvm::Function *F);
+unsigned long long int calculateCollisions(uint32_t edges);
+void                   scanForDangerousFunctions(llvm::Module *M);
+
+#ifndef IS_EXTERN
+  #define IS_EXTERN
+#endif
+
+IS_EXTERN int debug;
+IS_EXTERN int be_quiet;
+
+#undef IS_EXTERN
+
+#endif
+