fix warning, code format

This commit is contained in:
van Hauser
2020-05-10 11:35:31 +02:00
parent 3beec8d4fa
commit 26f8708fed
42 changed files with 656 additions and 658 deletions

View File

@ -12,13 +12,13 @@ typedef long double max_align_t;
#include "llvm/ADT/DenseSet.h"
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/CFG.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/DebugInfo.h"
# include "llvm/IR/CFG.h"
# include "llvm/IR/Dominators.h"
# include "llvm/IR/DebugInfo.h"
#else
#include "llvm/Support/CFG.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/DebugInfo.h"
# include "llvm/Support/CFG.h"
# include "llvm/Analysis/Dominators.h"
# include "llvm/DebugInfo.h"
#endif
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
@ -97,7 +97,7 @@ struct InsTrim : public ModulePass {
#if LLVM_VERSION_MAJOR >= 4 || \
(LLVM_VERSION_MAJOR == 4 && LLVM_VERSION_PATCH >= 1)
#define AFL_HAVE_VECTOR_INTRINSICS 1
# define AFL_HAVE_VECTOR_INTRINSICS 1
#endif
bool runOnModule(Module &M) override {
@ -137,13 +137,13 @@ struct InsTrim : public ModulePass {
getenv("AFL_LLVM_SKIPSINGLEBLOCK"))
function_minimum_size = 2;
unsigned PrevLocSize = 0;
char * ngram_size_str = getenv("AFL_LLVM_NGRAM_SIZE");
unsigned int PrevLocSize = 0;
char * ngram_size_str = getenv("AFL_LLVM_NGRAM_SIZE");
if (!ngram_size_str) ngram_size_str = getenv("AFL_NGRAM_SIZE");
char *ctx_str = getenv("AFL_LLVM_CTX");
#ifdef AFL_HAVE_VECTOR_INTRINSICS
int ngram_size = 0;
unsigned int ngram_size = 0;
/* Decide previous location vector size (must be a power of two) */
VectorType *PrevLocTy;
@ -196,17 +196,17 @@ struct InsTrim : public ModulePass {
#ifdef AFL_HAVE_VECTOR_INTRINSICS
if (ngram_size)
#ifdef __ANDROID__
# ifdef __ANDROID__
AFLPrevLoc = new GlobalVariable(
M, PrevLocTy, /* isConstant */ false, GlobalValue::ExternalLinkage,
/* Initializer */ nullptr, "__afl_prev_loc");
#else
# else
AFLPrevLoc = new GlobalVariable(
M, PrevLocTy, /* isConstant */ false, GlobalValue::ExternalLinkage,
/* Initializer */ nullptr, "__afl_prev_loc",
/* InsertBefore */ nullptr, GlobalVariable::GeneralDynamicTLSModel,
/* AddressSpace */ 0, /* IsExternallyInitialized */ false);
#endif
# endif
else
#endif
#ifdef __ANDROID__

View File

@ -15,9 +15,9 @@ typedef long double max_align_t;
#include "llvm/IR/BasicBlock.h"
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/CFG.h"
# include "llvm/IR/CFG.h"
#else
#include "llvm/Support/CFG.h"
# include "llvm/Support/CFG.h"
#endif
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"

View File

@ -25,11 +25,11 @@ typedef long double max_align_t;
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/CFG.h"
# include "llvm/IR/DebugInfo.h"
# include "llvm/IR/CFG.h"
#else
#include "llvm/DebugInfo.h"
#include "llvm/Support/CFG.h"
# include "llvm/DebugInfo.h"
# include "llvm/Support/CFG.h"
#endif
char * getBBName(const llvm::BasicBlock *BB);

View File

@ -54,11 +54,11 @@ typedef long double max_align_t;
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/CFG.h"
# include "llvm/IR/DebugInfo.h"
# include "llvm/IR/CFG.h"
#else
#include "llvm/DebugInfo.h"
#include "llvm/Support/CFG.h"
# include "llvm/DebugInfo.h"
# include "llvm/Support/CFG.h"
#endif
#include "afl-llvm-common.h"
@ -115,7 +115,7 @@ uint64_t PowerOf2Ceil(unsigned in) {
/* #if LLVM_VERSION_STRING >= "4.0.1" */
#if LLVM_VERSION_MAJOR >= 4 || \
(LLVM_VERSION_MAJOR == 4 && LLVM_VERSION_PATCH >= 1)
#define AFL_HAVE_VECTOR_INTRINSICS 1
# define AFL_HAVE_VECTOR_INTRINSICS 1
#endif
bool AFLCoverage::runOnModule(Module &M) {
@ -242,17 +242,17 @@ bool AFLCoverage::runOnModule(Module &M) {
#ifdef AFL_HAVE_VECTOR_INTRINSICS
if (ngram_size)
#ifdef __ANDROID__
# ifdef __ANDROID__
AFLPrevLoc = new GlobalVariable(
M, PrevLocTy, /* isConstant */ false, GlobalValue::ExternalLinkage,
/* Initializer */ nullptr, "__afl_prev_loc");
#else
# else
AFLPrevLoc = new GlobalVariable(
M, PrevLocTy, /* isConstant */ false, GlobalValue::ExternalLinkage,
/* Initializer */ nullptr, "__afl_prev_loc",
/* InsertBefore */ nullptr, GlobalVariable::GeneralDynamicTLSModel,
/* AddressSpace */ 0, /* IsExternallyInitialized */ false);
#endif
# endif
else
#endif
#ifdef __ANDROID__

View File

@ -21,7 +21,7 @@
*/
#ifdef __ANDROID__
#include "android-ashmem.h"
# include "android-ashmem.h"
#endif
#include "config.h"
#include "types.h"
@ -43,7 +43,7 @@
#include <sys/types.h>
#ifdef __linux__
#include "snapshot-inl.h"
# include "snapshot-inl.h"
#endif
/* This is a somewhat ugly hack for the experimental 'trace-pc-guard' mode.
@ -53,7 +53,7 @@
#define CONST_PRIO 5
#ifndef MAP_FIXED_NOREPLACE
#define MAP_FIXED_NOREPLACE MAP_FIXED
# define MAP_FIXED_NOREPLACE MAP_FIXED
#endif
#include <sys/mman.h>
@ -822,15 +822,15 @@ void __cmplog_ins_hook8(uint64_t arg1, uint64_t arg2) {
}
#if defined(__APPLE__)
#pragma weak __sanitizer_cov_trace_const_cmp1 = __cmplog_ins_hook1
#pragma weak __sanitizer_cov_trace_const_cmp2 = __cmplog_ins_hook2
#pragma weak __sanitizer_cov_trace_const_cmp4 = __cmplog_ins_hook4
#pragma weak __sanitizer_cov_trace_const_cmp8 = __cmplog_ins_hook8
# pragma weak __sanitizer_cov_trace_const_cmp1 = __cmplog_ins_hook1
# pragma weak __sanitizer_cov_trace_const_cmp2 = __cmplog_ins_hook2
# pragma weak __sanitizer_cov_trace_const_cmp4 = __cmplog_ins_hook4
# pragma weak __sanitizer_cov_trace_const_cmp8 = __cmplog_ins_hook8
#pragma weak __sanitizer_cov_trace_cmp1 = __cmplog_ins_hook1
#pragma weak __sanitizer_cov_trace_cmp2 = __cmplog_ins_hook2
#pragma weak __sanitizer_cov_trace_cmp4 = __cmplog_ins_hook4
#pragma weak __sanitizer_cov_trace_cmp8 = __cmplog_ins_hook8
# pragma weak __sanitizer_cov_trace_cmp1 = __cmplog_ins_hook1
# pragma weak __sanitizer_cov_trace_cmp2 = __cmplog_ins_hook2
# pragma weak __sanitizer_cov_trace_cmp4 = __cmplog_ins_hook4
# pragma weak __sanitizer_cov_trace_cmp8 = __cmplog_ins_hook8
#else
void __sanitizer_cov_trace_const_cmp1(uint8_t arg1, uint8_t arg2)
__attribute__((alias("__cmplog_ins_hook1")));

View File

@ -38,12 +38,12 @@
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/Verifier.h"
#include "llvm/IR/DebugInfo.h"
# include "llvm/IR/Verifier.h"
# include "llvm/IR/DebugInfo.h"
#else
#include "llvm/Analysis/Verifier.h"
#include "llvm/DebugInfo.h"
#define nullptr 0
# include "llvm/Analysis/Verifier.h"
# include "llvm/DebugInfo.h"
# define nullptr 0
#endif
#include <set>

View File

@ -38,12 +38,12 @@
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/Verifier.h"
#include "llvm/IR/DebugInfo.h"
# include "llvm/IR/Verifier.h"
# include "llvm/IR/DebugInfo.h"
#else
#include "llvm/Analysis/Verifier.h"
#include "llvm/DebugInfo.h"
#define nullptr 0
# include "llvm/Analysis/Verifier.h"
# include "llvm/DebugInfo.h"
# define nullptr 0
#endif
#include <set>

View File

@ -38,12 +38,12 @@
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/Verifier.h"
#include "llvm/IR/DebugInfo.h"
# include "llvm/IR/Verifier.h"
# include "llvm/IR/DebugInfo.h"
#else
#include "llvm/Analysis/Verifier.h"
#include "llvm/DebugInfo.h"
#define nullptr 0
# include "llvm/Analysis/Verifier.h"
# include "llvm/DebugInfo.h"
# define nullptr 0
#endif
#include <set>

View File

@ -37,12 +37,12 @@
#include "llvm/IR/IRBuilder.h"
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/Verifier.h"
#include "llvm/IR/DebugInfo.h"
# include "llvm/IR/Verifier.h"
# include "llvm/IR/DebugInfo.h"
#else
#include "llvm/Analysis/Verifier.h"
#include "llvm/DebugInfo.h"
#define nullptr 0
# include "llvm/Analysis/Verifier.h"
# include "llvm/DebugInfo.h"
# define nullptr 0
#endif
using namespace llvm;

View File

@ -40,12 +40,12 @@
#include "llvm/IR/IRBuilder.h"
#if LLVM_VERSION_MAJOR > 3 || \
(LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR > 4)
#include "llvm/IR/Verifier.h"
#include "llvm/IR/DebugInfo.h"
# include "llvm/IR/Verifier.h"
# include "llvm/IR/DebugInfo.h"
#else
#include "llvm/Analysis/Verifier.h"
#include "llvm/DebugInfo.h"
#define nullptr 0
# include "llvm/Analysis/Verifier.h"
# include "llvm/DebugInfo.h"
# define nullptr 0
#endif
#include <set>