aboutsummaryrefslogtreecommitdiff
path: root/llvm_mode
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-07-30 18:01:18 +0200
committervan Hauser <vh@thc.org>2020-07-30 18:01:18 +0200
commit486e5365d9e5cb56ffd5b5ade2f81a728de4a175 (patch)
treeeae69f8fa0b6e5fc2f6c8aaa77fd880c3030e90d /llvm_mode
parent8e809d8593d9230c123aa22c8cd0b695e54d7c68 (diff)
downloadafl++-486e5365d9e5cb56ffd5b5ade2f81a728de4a175.tar.gz
fix float splitting if not on a tty
Diffstat (limited to 'llvm_mode')
-rw-r--r--llvm_mode/split-compares-pass.so.cc38
1 files changed, 25 insertions, 13 deletions
diff --git a/llvm_mode/split-compares-pass.so.cc b/llvm_mode/split-compares-pass.so.cc
index 55128ca2..f65adde8 100644
--- a/llvm_mode/split-compares-pass.so.cc
+++ b/llvm_mode/split-compares-pass.so.cc
@@ -1247,7 +1247,8 @@ size_t SplitComparesTransform::splitIntCompares(Module &M, unsigned bitw) {
bool SplitComparesTransform::runOnModule(Module &M) {
- int bitw = 64;
+ int bitw = 64;
+ size_t count;
char *bitw_env = getenv("AFL_LLVM_LAF_SPLIT_COMPARES_BITW");
if (!bitw_env) bitw_env = getenv("LAF_SPLIT_COMPARES_BITW");
@@ -1261,18 +1262,26 @@ bool SplitComparesTransform::runOnModule(Module &M) {
errs() << "Split-compare-pass by laf.intel@gmail.com, extended by "
"heiko@hexco.de\n";
- if (enableFPSplit) {
+ } else {
+
+ be_quiet = 1;
+
+ }
+
+ if (enableFPSplit) {
- errs() << "Split-floatingpoint-compare-pass: " << splitFPCompares(M)
+ count = splitFPCompares(M);
+
+ if (!be_quiet) {
+
+ errs() << "Split-floatingpoint-compare-pass: " << count
<< " FP comparisons splitted\n";
}
- } else
+ simplifyFPCompares(M);
- be_quiet = 1;
-
- if (enableFPSplit) simplifyFPCompares(M);
+ }
simplifyCompares(M);
@@ -1281,9 +1290,10 @@ bool SplitComparesTransform::runOnModule(Module &M) {
switch (bitw) {
case 64:
+ count = splitIntCompares(M, bitw);
if (!be_quiet)
- errs() << "Split-integer-compare-pass " << bitw
- << "bit: " << splitIntCompares(M, bitw) << " splitted\n";
+ errs() << "Split-integer-compare-pass " << bitw << "bit: " << count
+ << " splitted\n";
bitw >>= 1;
#if LLVM_VERSION_MAJOR > 3 || \
@@ -1291,9 +1301,10 @@ bool SplitComparesTransform::runOnModule(Module &M) {
[[clang::fallthrough]]; /*FALLTHRU*/ /* FALLTHROUGH */
#endif
case 32:
+ count = splitIntCompares(M, bitw);
if (!be_quiet)
- errs() << "Split-integer-compare-pass " << bitw
- << "bit: " << splitIntCompares(M, bitw) << " splitted\n";
+ errs() << "Split-integer-compare-pass " << bitw << "bit: " << count
+ << " splitted\n";
bitw >>= 1;
#if LLVM_VERSION_MAJOR > 3 || \
@@ -1301,9 +1312,10 @@ bool SplitComparesTransform::runOnModule(Module &M) {
[[clang::fallthrough]]; /*FALLTHRU*/ /* FALLTHROUGH */
#endif
case 16:
+ count = splitIntCompares(M, bitw);
if (!be_quiet)
- errs() << "Split-integer-compare-pass " << bitw
- << "bit: " << splitIntCompares(M, bitw) << " splitted\n";
+ errs() << "Split-integer-compare-pass " << bitw << "bit: " << count
+ << " splitted\n";
bitw >>= 1;
break;