1 //===-- Operations.h - ----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Implementations of common fuzzer operation descriptors for building an IR
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_FUZZMUTATE_OPERATIONS_H
16 #define LLVM_FUZZMUTATE_OPERATIONS_H
18 #include "llvm/FuzzMutate/OpDescriptor.h"
19 #include "llvm/IR/InstrTypes.h"
20 #include "llvm/IR/Instruction.h"
24 /// Getters for the default sets of operations, per general category.
26 void describeFuzzerIntOps(std::vector<fuzzerop::OpDescriptor> &Ops);
27 void describeFuzzerFloatOps(std::vector<fuzzerop::OpDescriptor> &Ops);
28 void describeFuzzerControlFlowOps(std::vector<fuzzerop::OpDescriptor> &Ops);
29 void describeFuzzerPointerOps(std::vector<fuzzerop::OpDescriptor> &Ops);
30 void describeFuzzerAggregateOps(std::vector<fuzzerop::OpDescriptor> &Ops);
31 void describeFuzzerVectorOps(std::vector<fuzzerop::OpDescriptor> &Ops);
36 /// Descriptors for individual operations.
38 OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op);
39 OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp,
40 CmpInst::Predicate Pred);
41 OpDescriptor splitBlockDescriptor(unsigned Weight);
42 OpDescriptor gepDescriptor(unsigned Weight);
43 OpDescriptor extractValueDescriptor(unsigned Weight);
44 OpDescriptor insertValueDescriptor(unsigned Weight);
45 OpDescriptor extractElementDescriptor(unsigned Weight);
46 OpDescriptor insertElementDescriptor(unsigned Weight);
47 OpDescriptor shuffleVectorDescriptor(unsigned Weight);
50 } // end fuzzerop namespace
52 } // end llvm namespace
54 #endif // LLVM_FUZZMUTATE_OPERATIONS_H