about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--llvm_mode/afl-clang-fast.c2
-rw-r--r--llvm_mode/afl-llvm-pass.so.cc2
-rw-r--r--llvm_mode/compare-transform-pass.so.cc2
-rw-r--r--llvm_mode/split-compares-pass.so.cc7
-rw-r--r--llvm_mode/split-switches-pass.so.cc4
5 files changed, 9 insertions, 8 deletions
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c
index a760959f..751d25b8 100644
--- a/llvm_mode/afl-clang-fast.c
+++ b/llvm_mode/afl-clang-fast.c
@@ -498,7 +498,7 @@ int main(int argc, char** argv, char** envp) {
 
     exit(1);
 
-  } else if (isatty(2) && !getenv("AFL_QUIET")) {
+  } else if ((isatty(2) && !getenv("AFL_QUIET")) || !getenv("AFL_DEBUG")) {
 
 #ifdef USE_TRACE_PC
     SAYF(cCYA "afl-clang-fast" VERSION cRST
diff --git a/llvm_mode/afl-llvm-pass.so.cc b/llvm_mode/afl-llvm-pass.so.cc
index 555510cc..b78c7660 100644
--- a/llvm_mode/afl-llvm-pass.so.cc
+++ b/llvm_mode/afl-llvm-pass.so.cc
@@ -149,7 +149,7 @@ bool AFLCoverage::runOnModule(Module &M) {
 
     SAYF(cCYA "afl-llvm-pass" VERSION cRST " by <lszekeres@google.com>\n");
 
-  } else if (getenv("AFL_QUIET"))
+  } else
 
     be_quiet = 1;
 
diff --git a/llvm_mode/compare-transform-pass.so.cc b/llvm_mode/compare-transform-pass.so.cc
index e1332a9d..94b256f7 100644
--- a/llvm_mode/compare-transform-pass.so.cc
+++ b/llvm_mode/compare-transform-pass.so.cc
@@ -496,7 +496,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
 
 bool CompareTransform::runOnModule(Module &M) {
 
-  if (getenv("AFL_QUIET") == NULL)
+  if (isatty(2) && getenv("AFL_QUIET") == NULL)
     llvm::errs() << "Running compare-transform-pass by laf.intel@gmail.com, "
                     "extended by heiko@hexco.de\n";
   transformCmps(M, true, true, true, true, true);
diff --git a/llvm_mode/split-compares-pass.so.cc b/llvm_mode/split-compares-pass.so.cc
index e16993d6..1c7a77c3 100644
--- a/llvm_mode/split-compares-pass.so.cc
+++ b/llvm_mode/split-compares-pass.so.cc
@@ -1243,13 +1243,14 @@ bool SplitComparesTransform::runOnModule(Module &M) {
 
   simplifyIntSignedness(M);
 
-  if (getenv("AFL_QUIET") == NULL)
+  if (isatty(2) && getenv("AFL_QUIET") == NULL) {
     errs() << "Split-compare-pass by laf.intel@gmail.com, extended by "
               "heiko@hexco.de\n";
 
-  if (enableFPSplit)
-    errs() << "Split-floatingpoint-compare-pass: " << splitFPCompares(M)
+    if (enableFPSplit)
+      errs() << "Split-floatingpoint-compare-pass: " << splitFPCompares(M)
            << " FP comparisons splitted\n";
+  }
 
   switch (bitw) {
 
diff --git a/llvm_mode/split-switches-pass.so.cc b/llvm_mode/split-switches-pass.so.cc
index 9101dc26..70ffe7b6 100644
--- a/llvm_mode/split-switches-pass.so.cc
+++ b/llvm_mode/split-switches-pass.so.cc
@@ -491,7 +491,7 @@ bool SplitSwitchesTransform::splitSwitches(Module &M) {
      * less, don't bother with the code below. */
     if (!SI->getNumCases() || bitw <= 8) {
 
-      if (getenv("AFL_QUIET") == NULL) errs() << "skip trivial switch..\n";
+      if (isatty(2) && getenv("AFL_QUIET") == NULL) errs() << "skip trivial switch..\n";
       continue;
 
     }
@@ -556,7 +556,7 @@ bool SplitSwitchesTransform::splitSwitches(Module &M) {
 
 bool SplitSwitchesTransform::runOnModule(Module &M) {
 
-  if (getenv("AFL_QUIET") == NULL)
+  if (isatty(2) && getenv("AFL_QUIET") == NULL)
     llvm::errs() << "Running split-switches-pass by laf.intel@gmail.com\n";
   splitSwitches(M);
   verifyModule(M);