diff options
author | vanhauser-thc <vh@thc.org> | 2022-03-03 08:55:05 +0100 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2022-03-03 08:55:05 +0100 |
commit | f2831419f5ceb28e1bc0cbf67cada012bccfb843 (patch) | |
tree | a2651279ab4f80adb6eeaa699d3a1783e42c9e84 /instrumentation/cmplog-routines-pass.cc | |
parent | d325fa5db8287e0b4984b12b07b16cf0f643c468 (diff) | |
download | afl++-f2831419f5ceb28e1bc0cbf67cada012bccfb843.tar.gz |
ported cmplog-instructions-pass
Diffstat (limited to 'instrumentation/cmplog-routines-pass.cc')
-rw-r--r-- | instrumentation/cmplog-routines-pass.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/instrumentation/cmplog-routines-pass.cc b/instrumentation/cmplog-routines-pass.cc index 2af01a7a..2c2f2fc4 100644 --- a/instrumentation/cmplog-routines-pass.cc +++ b/instrumentation/cmplog-routines-pass.cc @@ -83,7 +83,31 @@ class CmpLogRoutines : public ModulePass { } // namespace + +#if LLVM_MAJOR >= 11 && 1 == 0 +llvmGetPassPluginInfo() { + + return {LLVM_PLUGIN_API_VERSION, "cmplogroutines", "v0.1", + /* lambda to insert our pass into the pass pipeline. */ + [](PassBuilder &PB) { + +#if LLVM_VERSION_MAJOR <= 13 + using OptimizationLevel = typename PassBuilder::OptimizationLevel; +#endif + PB.registerOptimizerLastEPCallback( + [](ModulePassManager &MPM, OptimizationLevel OL) { + + MPM.addPass(SplitComparesTransform()); + + }); + }}; + +} +#else char CmpLogRoutines::ID = 0; +#endif + + bool CmpLogRoutines::hookRtns(Module &M) { |