format and remove warning
MODIFY
instrumentation/SanitizerCoverageLTO.so.cc
instrumentation/SanitizerCoverageLTO.so.cc
@@ -447,8 +447,7 @@ bool ModuleSanitizerCoverage::instrumentModule(
if ((ptr = getenv("AFL_LLVM_DOCUMENT_IDS")) != NULL) {
dFile.open(ptr, std::ofstream::out | std::ofstream::app);
- if (dFile.is_open())
- WARNF("Cannot access document file %s", ptr);
+ if (dFile.is_open()) WARNF("Cannot access document file %s", ptr);
}
@@ -1502,7 +1501,8 @@ void ModuleSanitizerCoverage::InjectCoverageAtBlock(Function &F, BasicBlock &BB,
unsigned long long int moduleID =
(((unsigned long long int)(rand() & 0xffffffff)) << 32) | getpid();
- dFile << "ModuleID=" << moduleID << " Function=" << F.getName().str() << " edgeID=" << afl_global_id << "\n";
+ dFile << "ModuleID=" << moduleID << " Function=" << F.getName().str()
+ << " edgeID=" << afl_global_id << "\n";
}

MODIFY
instrumentation/afl-llvm-dict2file.so.cc
instrumentation/afl-llvm-dict2file.so.cc
@@ -65,8 +65,10 @@ using namespace llvm;
namespace {
class AFLdict2filePass : public ModulePass {
+
std::ofstream of;
void dict2file(u8 *, u32);
+
public:
static char ID;
@@ -147,8 +149,7 @@ bool AFLdict2filePass::runOnModule(Module &M) {
FATAL("AFL_LLVM_DICT2FILE is not set to an absolute path: %s", ptr);
of.open(ptr, std::ofstream::out | std::ofstream::app);
- if (!of.is_open())
- PFATAL("Could not open/create %s.", ptr);
+ if (!of.is_open()) PFATAL("Could not open/create %s.", ptr);
/* Instrument all the things! */

MODIFY
instrumentation/afl-llvm-lto-instrumentation.so.cc
instrumentation/afl-llvm-lto-instrumentation.so.cc
@@ -138,8 +138,7 @@ bool AFLLTOPass::runOnModule(Module &M) {
if ((ptr = getenv("AFL_LLVM_DOCUMENT_IDS")) != NULL) {
dFile.open(ptr, std::ofstream::out | std::ofstream::app);
- if (!dFile.is_open())
- WARNF("Cannot access document file %s", ptr);
+ if (!dFile.is_open()) WARNF("Cannot access document file %s", ptr);
}
@@ -246,8 +245,10 @@ bool AFLLTOPass::runOnModule(Module &M) {
AttributeList Attrs = F.getAttributes();
#if LLVM_VERSION_MAJOR < 14
if (Attrs.hasAttribute(-1, StringRef("skipinstrument"))) {
+
#else
if (Attrs.hasFnAttr(StringRef("skipinstrument"))) {
+
#endif
if (debug)
@@ -852,7 +853,9 @@ bool AFLLTOPass::runOnModule(Module &M) {
if (dFile.is_open()) {
- dFile << "ModuleID=" << moduleID << " Function=" << F.getName().str() << " edgeID=" << afl_global_id << "\n";
+ dFile << "ModuleID=" << moduleID
+ << " Function=" << F.getName().str()
+ << " edgeID=" << afl_global_id << "\n";
}

MODIFY
instrumentation/split-compares-pass.so.cc
instrumentation/split-compares-pass.so.cc
@@ -579,15 +579,15 @@ bool SplitComparesTransform::splitCompare(CmpInst *cmp_inst, Module &M,
/* dependent on the cmp of the high parts go to the end or go on with
* the comparison */
auto term = bb->getTerminator();
- BranchInst *br = nullptr;
+
if (pred == CmpInst::ICMP_EQ) {
- br = BranchInst::Create(cmp_low_bb, end_bb, icmp_high, bb);
+ BranchInst::Create(cmp_low_bb, end_bb, icmp_high, bb);
} else {
- /* CmpInst::ICMP_NE */
- br = BranchInst::Create(end_bb, cmp_low_bb, icmp_high, bb);
+ // CmpInst::ICMP_NE
+ BranchInst::Create(end_bb, cmp_low_bb, icmp_high, bb);
}

format and remove warning