isatty for all compilers + AFL_DEBUG
MODIFY
llvm_mode/afl-clang-fast.c
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

MODIFY
llvm_mode/afl-llvm-pass.so.cc
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;

MODIFY
llvm_mode/compare-transform-pass.so.cc
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);

MODIFY
llvm_mode/split-compares-pass.so.cc
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)
<< " FP comparisons splitted\n";
+ }
switch (bitw) {

MODIFY
llvm_mode/split-switches-pass.so.cc
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);

isatty for all compilers + AFL_DEBUG