remove WIP code
diff --git a/custom_mutators/grammar_mutator/grammar_mutator b/custom_mutators/grammar_mutator/grammar_mutator
index ff4e5a2..cbe5e32 160000
--- a/custom_mutators/grammar_mutator/grammar_mutator
+++ b/custom_mutators/grammar_mutator/grammar_mutator
@@ -1 +1 @@
-Subproject commit ff4e5a265daf5d88c4a636fb6a2c22b1d733db09
+Subproject commit cbe5e32752773945e0142fac9f1b7a0ccb5dcdff
diff --git a/instrumentation/cmplog-instructions-pass.cc b/instrumentation/cmplog-instructions-pass.cc
index 85d4883..4d37bcb 100644
--- a/instrumentation/cmplog-instructions-pass.cc
+++ b/instrumentation/cmplog-instructions-pass.cc
@@ -32,15 +32,9 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#if LLVM_MAJOR >= 11
- #include "llvm/Pass.h"
- #include "llvm/InitializePasses.h"
#include "llvm/Passes/PassPlugin.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/IR/PassManager.h"
- #include "llvm/Analysis/EHPersonalities.h"
- #include "llvm/Analysis/PostDominators.h"
- #include "llvm/Analysis/LoopInfo.h"
- #include "llvm/Analysis/LoopPass.h"
#else
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
@@ -70,10 +64,7 @@
namespace {
-using LoopInfoCallback = function_ref<const LoopInfo *(Function &F)>;
-
#if LLVM_MAJOR >= 11 /* use new pass manager */
-
class CmpLogInstructions : public PassInfoMixin<CmpLogInstructions> {
public:
@@ -97,7 +88,6 @@
#endif
#if LLVM_MAJOR >= 11 /* use new pass manager */
-
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
#else
bool runOnModule(Module &M) override;
@@ -116,8 +106,7 @@
#endif
private:
- bool hookInstrs(Module &M, LoopInfoCallback LCallback);
- unsigned int instrumented = 0;
+ bool hookInstrs(Module &M);
};
@@ -164,7 +153,7 @@
}
-bool CmpLogInstructions::hookInstrs(Module &M, LoopInfoCallback LCallback) {
+bool CmpLogInstructions::hookInstrs(Module &M) {
std::vector<Instruction *> icomps;
LLVMContext & C = M.getContext();
@@ -301,64 +290,14 @@
if (!isInInstrumentList(&F, MNAME)) continue;
- std::vector<BasicBlock *> lcomps;
- const LoopInfo * LI = LCallback(F);
-#if 0
- for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) {
-
- Loop * L = *I;
- BasicBlock *In, *Out;
- bool ok = false ; L->getIncomingAndBackEdge(In, Out);
- if (ok) {
-
- BasicBlock *decisionBB = In->getSingleSuccessor();
-
- if (decisionBB) {
-
- /*
- std::string errMsg1;
- raw_string_ostream os1(errMsg1);
- In->print(os1);
- fprintf(stderr, "In: %s\n", os1.str().c_str());
- std::string errMsg2;
- raw_string_ostream os2(errMsg2);
- Out->print(os2);
- fprintf(stderr, "Out: %s\n", os2.str().c_str());
- std::string errMsg3;
- raw_string_ostream os3(errMsg3);
- decisionBB->print(os3);
- fprintf(stderr, "Dec: %s\n", os3.str().c_str());
- */
- lcomps.push_back(decisionBB);
-
- }
-
- }
-
- }
-
-#endif
-
- // fprintf(stderr, "Loops in %s: %zu\n", F.getName().str().c_str(),
- // lcomps.size());
-
for (auto &BB : F) {
- if (std::find(lcomps.begin(), lcomps.end(), &BB) != lcomps.end()) {
-
- fprintf(stderr, "skipping: %p %s\n", &BB, BB.getName().str().c_str());
-
- continue;
-
- }
-
for (auto &IN : BB) {
CmpInst *selectcmpInst = nullptr;
if ((selectcmpInst = dyn_cast<CmpInst>(&IN))) {
icomps.push_back(selectcmpInst);
- fprintf(stderr, "Found icomp %p in %p\n", selectcmpInst, &BB);
}
@@ -706,8 +645,6 @@
}
- ++instrumented;
-
}
/* else fprintf(stderr, "skipped\n"); */
@@ -721,8 +658,6 @@
}
- fprintf(stderr, "instrumented: %u (%zu)\n", instrumented, icomps.size());
-
if (icomps.size())
return true;
else
@@ -743,19 +678,9 @@
printf("Running cmplog-instructions-pass by andreafioraldi@gmail.com\n");
else
be_quiet = 1;
-
- auto &FAM = MAM.getResult<FunctionAnalysisManagerModuleProxy>(M).getManager();
- auto LoopCallback = [&FAM](Function &F) -> const LoopInfo * {
-
- return &FAM.getResult<LoopAnalysis>(F);
-
- };
-
- hookInstrs(M, LoopCallback);
+ hookInstrs(M);
verifyModule(M);
- fprintf(stderr, "done cmplog-instructions-pass\n");
-
#if LLVM_MAJOR >= 11 /* use new pass manager */
return PreservedAnalyses::all();
#else
diff --git a/instrumentation/cmplog-routines-pass.cc b/instrumentation/cmplog-routines-pass.cc
index 708a94b..8205cfb 100644
--- a/instrumentation/cmplog-routines-pass.cc
+++ b/instrumentation/cmplog-routines-pass.cc
@@ -761,8 +761,6 @@
#endif
verifyModule(M);
- fprintf(stderr, "done cmplog-routines-pass\n");
-
#if LLVM_VERSION_MAJOR >= 11 /* use new pass manager */
return PA;
#else
diff --git a/unicorn_mode/unicornafl b/unicorn_mode/unicornafl
index a44fa94..d491505 160000
--- a/unicorn_mode/unicornafl
+++ b/unicorn_mode/unicornafl
@@ -1 +1 @@
-Subproject commit a44fa94488d01aba60401ccf81f8bebcce685bf2
+Subproject commit d4915053d477dd827b3fe4b494173d3fbf9f456e