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-switches-pass.cc | |
parent | d325fa5db8287e0b4984b12b07b16cf0f643c468 (diff) | |
download | afl++-f2831419f5ceb28e1bc0cbf67cada012bccfb843.tar.gz |
ported cmplog-instructions-pass
Diffstat (limited to 'instrumentation/cmplog-switches-pass.cc')
-rw-r--r-- | instrumentation/cmplog-switches-pass.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/instrumentation/cmplog-switches-pass.cc b/instrumentation/cmplog-switches-pass.cc index 068650ce..7c591e13 100644 --- a/instrumentation/cmplog-switches-pass.cc +++ b/instrumentation/cmplog-switches-pass.cc @@ -84,7 +84,28 @@ class CmpLogInstructions : public ModulePass { } // namespace +#if LLVM_MAJOR >= 11 && 1 == 0 +llvmGetPassPluginInfo() { + + return {LLVM_PLUGIN_API_VERSION, "cmplogswitches", "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 CmpLogInstructions::ID = 0; +#endif template <class Iterator> Iterator Unique(Iterator first, Iterator last) { |