about summary refs log tree commit diff
path: root/instrumentation/afl-llvm-lto-instrumentlist.so.cc
diff options
context:
space:
mode:
authorAndrea Fioraldi <andreafioraldi@gmail.com>2021-10-19 13:59:38 +0200
committerAndrea Fioraldi <andreafioraldi@gmail.com>2021-10-19 13:59:38 +0200
commit23e69f11075b20c4907ebe902af08dcbb13ec175 (patch)
tree9bd59c8786c8a81370373484778c0aeb1770d095 /instrumentation/afl-llvm-lto-instrumentlist.so.cc
parent77a63d8ccfd4b409c35227e174f1d6e809256e41 (diff)
parentbb8a4d71da8f2b748a78ccc4416df6bffb393d80 (diff)
downloadafl++-23e69f11075b20c4907ebe902af08dcbb13ec175.tar.gz
Merge branch 'dev' of github.com:AFLplusplus/AFLplusplus into dev
Diffstat (limited to 'instrumentation/afl-llvm-lto-instrumentlist.so.cc')
-rw-r--r--instrumentation/afl-llvm-lto-instrumentlist.so.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/instrumentation/afl-llvm-lto-instrumentlist.so.cc b/instrumentation/afl-llvm-lto-instrumentlist.so.cc
index 416dbb88..ee2e5dd3 100644
--- a/instrumentation/afl-llvm-lto-instrumentlist.so.cc
+++ b/instrumentation/afl-llvm-lto-instrumentlist.so.cc
@@ -116,10 +116,15 @@ bool AFLcheckIfInstrument::runOnModule(Module &M) {
 
       auto &        Ctx = F.getContext();
       AttributeList Attrs = F.getAttributes();
-      AttrBuilder   NewAttrs;
+#if LLVM_VERSION_MAJOR < 14
+      AttrBuilder NewAttrs;
       NewAttrs.addAttribute("skipinstrument");
       F.setAttributes(
           Attrs.addAttributes(Ctx, AttributeList::FunctionIndex, NewAttrs));
+#else
+      AttributeList NewAttrs = Attrs.addFnAttribute(Ctx, "skipinstrument");
+      F.setAttributes(NewAttrs);
+#endif
 
     }