mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-12 18:18:07 +00:00
LLVM 14 fixes
This commit is contained in:
@ -17,6 +17,7 @@
|
|||||||
#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
|
#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
|
||||||
#include "llvm/ADT/ArrayRef.h"
|
#include "llvm/ADT/ArrayRef.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
|
#include "llvm/ADT/Triple.h"
|
||||||
#include "llvm/Analysis/EHPersonalities.h"
|
#include "llvm/Analysis/EHPersonalities.h"
|
||||||
#include "llvm/Analysis/PostDominators.h"
|
#include "llvm/Analysis/PostDominators.h"
|
||||||
#include "llvm/Analysis/ValueTracking.h"
|
#include "llvm/Analysis/ValueTracking.h"
|
||||||
@ -757,7 +758,7 @@ bool ModuleSanitizerCoverage::instrumentModule(
|
|||||||
if (!HasStr2) {
|
if (!HasStr2) {
|
||||||
|
|
||||||
auto *Ptr = dyn_cast<ConstantExpr>(Str2P);
|
auto *Ptr = dyn_cast<ConstantExpr>(Str2P);
|
||||||
if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) {
|
if (Ptr && Ptr->getOpcode() == Instruction::GetElementPtr) {
|
||||||
|
|
||||||
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
||||||
|
|
||||||
@ -838,7 +839,7 @@ bool ModuleSanitizerCoverage::instrumentModule(
|
|||||||
|
|
||||||
auto Ptr = dyn_cast<ConstantExpr>(Str1P);
|
auto Ptr = dyn_cast<ConstantExpr>(Str1P);
|
||||||
|
|
||||||
if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) {
|
if (Ptr && Ptr->getOpcode() == Instruction::GetElementPtr) {
|
||||||
|
|
||||||
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
|
#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
|
||||||
#include "llvm/ADT/ArrayRef.h"
|
#include "llvm/ADT/ArrayRef.h"
|
||||||
#include "llvm/ADT/SmallVector.h"
|
#include "llvm/ADT/SmallVector.h"
|
||||||
|
#include "llvm/ADT/Triple.h"
|
||||||
#include "llvm/Analysis/EHPersonalities.h"
|
#include "llvm/Analysis/EHPersonalities.h"
|
||||||
#include "llvm/Analysis/PostDominators.h"
|
#include "llvm/Analysis/PostDominators.h"
|
||||||
#include "llvm/IR/CFG.h"
|
#include "llvm/IR/CFG.h"
|
||||||
|
@ -435,7 +435,7 @@ bool AFLdict2filePass::runOnModule(Module &M) {
|
|||||||
if (!HasStr2) {
|
if (!HasStr2) {
|
||||||
|
|
||||||
auto *Ptr = dyn_cast<ConstantExpr>(Str2P);
|
auto *Ptr = dyn_cast<ConstantExpr>(Str2P);
|
||||||
if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) {
|
if (Ptr && Ptr->getOpcode() == Instruction::GetElementPtr) {
|
||||||
|
|
||||||
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
||||||
|
|
||||||
@ -519,7 +519,7 @@ bool AFLdict2filePass::runOnModule(Module &M) {
|
|||||||
|
|
||||||
auto Ptr = dyn_cast<ConstantExpr>(Str1P);
|
auto Ptr = dyn_cast<ConstantExpr>(Str1P);
|
||||||
|
|
||||||
if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) {
|
if (Ptr && Ptr->getOpcode() == Instruction::GetElementPtr) {
|
||||||
|
|
||||||
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "llvm/IR/IRBuilder.h"
|
#include "llvm/IR/IRBuilder.h"
|
||||||
#include "llvm/IR/LegacyPassManager.h"
|
#include "llvm/IR/LegacyPassManager.h"
|
||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
|
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
|
||||||
#include "llvm/IR/CFG.h"
|
#include "llvm/IR/CFG.h"
|
||||||
|
@ -45,6 +45,7 @@ typedef long double max_align_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "llvm/IR/IRBuilder.h"
|
#include "llvm/IR/IRBuilder.h"
|
||||||
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/IR/LegacyPassManager.h"
|
#include "llvm/IR/LegacyPassManager.h"
|
||||||
#include "llvm/IR/BasicBlock.h"
|
#include "llvm/IR/BasicBlock.h"
|
||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
|
@ -246,7 +246,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
|
|||||||
if (!(HasStr1 || HasStr2)) {
|
if (!(HasStr1 || HasStr2)) {
|
||||||
|
|
||||||
auto *Ptr = dyn_cast<ConstantExpr>(Str2P);
|
auto *Ptr = dyn_cast<ConstantExpr>(Str2P);
|
||||||
if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) {
|
if (Ptr && Ptr->getOpcode() == Instruction::GetElementPtr) {
|
||||||
|
|
||||||
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
|
|||||||
if (!HasStr2) {
|
if (!HasStr2) {
|
||||||
|
|
||||||
Ptr = dyn_cast<ConstantExpr>(Str1P);
|
Ptr = dyn_cast<ConstantExpr>(Str1P);
|
||||||
if (Ptr && Ptr->isGEPWithNoNotionalOverIndexing()) {
|
if (Ptr && Ptr->getOpcode() == Instruction::GetElementPtr) {
|
||||||
|
|
||||||
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
|
||||||
|
|
||||||
|
@ -549,8 +549,8 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_MAJOR >= 13
|
#if LLVM_MAJOR >= 13
|
||||||
// fuck you llvm 13
|
// Use the old pass manager in LLVM 14 which the afl++ passes still use.
|
||||||
cc_params[cc_par_cnt++] = "-fno-experimental-new-pass-manager";
|
cc_params[cc_par_cnt++] = "-flegacy-pass-manager";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (lto_mode && !have_c) {
|
if (lto_mode && !have_c) {
|
||||||
|
Reference in New Issue
Block a user