LLVM  6.0.0svn
Operations.h
Go to the documentation of this file.
1 //===-- Operations.h - ----------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Implementations of common fuzzer operation descriptors for building an IR
11 // mutator.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_FUZZMUTATE_OPERATIONS_H
16 #define LLVM_FUZZMUTATE_OPERATIONS_H
17 
19 #include "llvm/IR/InstrTypes.h"
20 #include "llvm/IR/Instruction.h"
21 
22 namespace llvm {
23 
24 /// Getters for the default sets of operations, per general category.
25 /// @{
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);
32 /// @}
33 
34 namespace fuzzerop {
35 
36 /// Descriptors for individual operations.
37 /// @{
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);
48 /// @}
49 
50 } // end fuzzerop namespace
51 
52 } // end llvm namespace
53 
54 #endif // LLVM_FUZZMUTATE_OPERATIONS_H
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
OpDescriptor insertElementDescriptor(unsigned Weight)
Definition: Operations.cpp:280
void describeFuzzerControlFlowOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:71
OpDescriptor binOpDescriptor(unsigned Weight, Instruction::BinaryOps Op)
Descriptors for individual operations.
Definition: Operations.cpp:92
OpDescriptor extractValueDescriptor(unsigned Weight)
Definition: Operations.cpp:207
void describeFuzzerVectorOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:86
OpDescriptor extractElementDescriptor(unsigned Weight)
Definition: Operations.cpp:272
OpDescriptor shuffleVectorDescriptor(unsigned Weight)
Definition: Operations.cpp:305
OpDescriptor splitBlockDescriptor(unsigned Weight)
Definition: Operations.cpp:141
OpDescriptor gepDescriptor(unsigned Weight)
Definition: Operations.cpp:166
void describeFuzzerFloatOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:46
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Definition: InstrTypes.h:853
void describeFuzzerPointerOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:76
OpDescriptor insertValueDescriptor(unsigned Weight)
Definition: Operations.cpp:260
void describeFuzzerIntOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Getters for the default sets of operations, per general category.
Definition: Operations.cpp:19
void describeFuzzerAggregateOps(std::vector< fuzzerop::OpDescriptor > &Ops)
Definition: Operations.cpp:80
OpDescriptor cmpOpDescriptor(unsigned Weight, Instruction::OtherOps CmpOp, CmpInst::Predicate Pred)
Definition: Operations.cpp:124