From 687b357b2db4155eabaa30195d8d532a6e6b1b62 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Wed, 19 Feb 2020 09:53:46 +0100 Subject: isatty for all compilers + AFL_DEBUG --- llvm_mode/split-switches-pass.so.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm_mode/split-switches-pass.so.cc') 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); -- cgit 1.4.1