Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:56

0001 //===-- Operations.h - ----------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // Implementations of common fuzzer operation descriptors for building an IR
0010 // mutator.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_FUZZMUTATE_OPERATIONS_H
0015 #define LLVM_FUZZMUTATE_OPERATIONS_H
0016 
0017 #include "llvm/FuzzMutate/OpDescriptor.h"
0018 #include "llvm/IR/InstrTypes.h"
0019 #include "llvm/IR/Instruction.h"
0020 
0021 namespace llvm {
0022 
0023 /// Getters for the default sets of operations, per general category.
0024 /// @{
0025 void describeFuzzerIntOps(std::vector<fuzzerop::OpDescriptor> &Ops);
0026 void describeFuzzerFloatOps(std::vector<fuzzerop::OpDescriptor> &Ops);
0027 void describeFuzzerControlFlowOps(std::vector<fuzzerop::OpDescriptor> &Ops);
0028 void describeFuzzerPointerOps(std::vector<fuzzerop::OpDescriptor> &Ops);
0029 void describeFuzzerAggregateOps(std::vector<fuzzerop::OpDescriptor> &Ops);
0030 void describeFuzzerVectorOps(std::vector<fuzzerop::OpDescriptor> &Ops);
0031 void describeFuzzerUnaryOperations(std::vector<fuzzerop::OpDescriptor> &Ops);
0032 void describeFuzzerOtherOps(std::vector<fuzzerop::OpDescriptor> &Ops);
0033 /// @}
0034 
0035 namespace fuzzerop {
0036 
0037 /// Descriptors for individual operations.
0038 /// @{
0039 OpDescriptor selectDescriptor(unsigned Weight);
0040 OpDescriptor fnegDescriptor(unsigned Weight);
0041 OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op);
0042 OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp,
0043                              CmpInst::Predicate Pred);
0044 OpDescriptor splitBlockDescriptor(unsigned Weight);
0045 OpDescriptor gepDescriptor(unsigned Weight);
0046 OpDescriptor extractValueDescriptor(unsigned Weight);
0047 OpDescriptor insertValueDescriptor(unsigned Weight);
0048 OpDescriptor extractElementDescriptor(unsigned Weight);
0049 OpDescriptor insertElementDescriptor(unsigned Weight);
0050 OpDescriptor shuffleVectorDescriptor(unsigned Weight);
0051 
0052 /// @}
0053 
0054 } // namespace fuzzerop
0055 
0056 } // namespace llvm
0057 
0058 #endif // LLVM_FUZZMUTATE_OPERATIONS_H