aboutsummaryrefslogtreecommitdiff
path: root/llvm_mode
diff options
context:
space:
mode:
Diffstat (limited to 'llvm_mode')
-rw-r--r--llvm_mode/LLVMInsTrim.so.cc21
-rw-r--r--llvm_mode/afl-clang-fast.c12
-rw-r--r--llvm_mode/afl-llvm-pass.so.cc12
-rw-r--r--llvm_mode/split-compares-pass.so.cc12
4 files changed, 33 insertions, 24 deletions
diff --git a/llvm_mode/LLVMInsTrim.so.cc b/llvm_mode/LLVMInsTrim.so.cc
index f723a0fe..1fa361b5 100644
--- a/llvm_mode/LLVMInsTrim.so.cc
+++ b/llvm_mode/LLVMInsTrim.so.cc
@@ -158,9 +158,9 @@ struct InsTrim : public ModulePass {
if (!myWhitelist.empty()) {
- bool instrumentBlock = false;
- DebugLoc Loc;
- StringRef instFilename;
+ bool instrumentBlock = false;
+ DebugLoc Loc;
+ StringRef instFilename;
unsigned int instLine = 0;
for (auto &BB : F) {
@@ -222,12 +222,17 @@ struct InsTrim : public ModulePass {
if (!instrumentBlock) {
if (!be_quiet) {
- if (!instFilename.str().empty())
- SAYF(cYEL "[!] " cBRI "Not in whitelist, skipping %s line %u...\n",
- instFilename.str().c_str(), instLine);
- else
- SAYF(cYEL "[!] " cBRI "No filename information found, skipping it");
+
+ if (!instFilename.str().empty())
+ SAYF(cYEL "[!] " cBRI
+ "Not in whitelist, skipping %s line %u...\n",
+ instFilename.str().c_str(), instLine);
+ else
+ SAYF(cYEL "[!] " cBRI
+ "No filename information found, skipping it");
+
}
+
continue;
}
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index b245cefa..e89b6183 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -122,15 +122,19 @@ static void edit_params(u32 argc, char** argv) {
if (!strcmp(name, "afl-clang-fast++")) {
u8* alt_cxx = getenv("AFL_CXX");
- if (has_llvm_config) snprintf(llvm_fullpath, sizeof(llvm_fullpath), "%s/clang++", LLVM_BINDIR);
- else sprintf(llvm_fullpath, "clang++");
+ if (has_llvm_config)
+ snprintf(llvm_fullpath, sizeof(llvm_fullpath), "%s/clang++", LLVM_BINDIR);
+ else
+ sprintf(llvm_fullpath, "clang++");
cc_params[0] = alt_cxx ? alt_cxx : (u8*)llvm_fullpath;
} else {
u8* alt_cc = getenv("AFL_CC");
- if (has_llvm_config) snprintf(llvm_fullpath, sizeof(llvm_fullpath), "%s/clang", LLVM_BINDIR);
- else sprintf(llvm_fullpath, "clang");
+ if (has_llvm_config)
+ snprintf(llvm_fullpath, sizeof(llvm_fullpath), "%s/clang", LLVM_BINDIR);
+ else
+ sprintf(llvm_fullpath, "clang");
cc_params[0] = alt_cc ? alt_cc : (u8*)llvm_fullpath;
}
diff --git a/llvm_mode/afl-llvm-pass.so.cc b/llvm_mode/afl-llvm-pass.so.cc
index 4ce073a5..1601a4f8 100644
--- a/llvm_mode/afl-llvm-pass.so.cc
+++ b/llvm_mode/afl-llvm-pass.so.cc
@@ -94,12 +94,12 @@ bool AFLCoverage::runOnModule(Module &M) {
LLVMContext &C = M.getContext();
- IntegerType *Int8Ty = IntegerType::getInt8Ty(C);
- IntegerType *Int32Ty = IntegerType::getInt32Ty(C);
- struct timeval tv;
- struct timezone tz;
- u32 rand_seed;
- unsigned int cur_loc = 0;
+ IntegerType * Int8Ty = IntegerType::getInt8Ty(C);
+ IntegerType * Int32Ty = IntegerType::getInt32Ty(C);
+ struct timeval tv;
+ struct timezone tz;
+ u32 rand_seed;
+ unsigned int cur_loc = 0;
/* Setup random() so we get Actually Random(TM) outputs from AFL_R() */
gettimeofday(&tv, &tz);
diff --git a/llvm_mode/split-compares-pass.so.cc b/llvm_mode/split-compares-pass.so.cc
index 60420f77..db884cde 100644
--- a/llvm_mode/split-compares-pass.so.cc
+++ b/llvm_mode/split-compares-pass.so.cc
@@ -103,11 +103,11 @@ bool SplitComparesTransform::simplifyCompares(Module &M) {
}
- if (enableFPSplit && (
- selectcmpInst->getPredicate() == CmpInst::FCMP_OGE ||
- selectcmpInst->getPredicate() == CmpInst::FCMP_UGE ||
- selectcmpInst->getPredicate() == CmpInst::FCMP_OLE ||
- selectcmpInst->getPredicate() == CmpInst::FCMP_ULE)) {
+ if (enableFPSplit &&
+ (selectcmpInst->getPredicate() == CmpInst::FCMP_OGE ||
+ selectcmpInst->getPredicate() == CmpInst::FCMP_UGE ||
+ selectcmpInst->getPredicate() == CmpInst::FCMP_OLE ||
+ selectcmpInst->getPredicate() == CmpInst::FCMP_ULE)) {
auto op0 = selectcmpInst->getOperand(0);
auto op1 = selectcmpInst->getOperand(1);
@@ -1046,7 +1046,7 @@ bool SplitComparesTransform::runOnModule(Module &M) {
char *bitw_env = getenv("LAF_SPLIT_COMPARES_BITW");
if (!bitw_env) bitw_env = getenv("AFL_LLVM_LAF_SPLIT_COMPARES_BITW");
if (bitw_env) { bitw = atoi(bitw_env); }
-
+
enableFPSplit = getenv("AFL_LLVM_LAF_SPLIT_FLOATS") != NULL;
simplifyCompares(M);