about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-10-14 14:25:35 +0200
committerGitHub <noreply@github.com>2023-10-14 14:25:35 +0200
commitc885a892ffac21838b80a977f1354a9e287ff0a2 (patch)
tree2b644714ba20356dfa41fed20b1761621c01a5af
parentaf18f2c7325551e8045a6156cb5b0ed2f4841dbf (diff)
parent943fa7eb7385376f96073421a1a5d7811dd613ec (diff)
downloadafl++-c885a892ffac21838b80a977f1354a9e287ff0a2.tar.gz
Merge pull request #1889 from AFLplusplus/early_llvm
Use EarlyEPCallback when llvm >= 16
-rw-r--r--instrumentation/SanitizerCoveragePCGUARD.so.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/instrumentation/SanitizerCoveragePCGUARD.so.cc b/instrumentation/SanitizerCoveragePCGUARD.so.cc
index 98c5973c..588eb950 100644
--- a/instrumentation/SanitizerCoveragePCGUARD.so.cc
+++ b/instrumentation/SanitizerCoveragePCGUARD.so.cc
@@ -214,7 +214,11 @@ llvmGetPassPluginInfo() {
 #if LLVM_VERSION_MAJOR == 13
             using OptimizationLevel = typename PassBuilder::OptimizationLevel;
 #endif
+#if LLVM_VERSION_MAJOR >= 16
+            PB.registerOptimizerEarlyEPCallback(
+#else
             PB.registerOptimizerLastEPCallback(
+#endif
                 [](ModulePassManager &MPM, OptimizationLevel OL) {
 
                   MPM.addPass(ModuleSanitizerCoverageAFL());