12 #ifndef LLVM_FUZZER_DICTIONARY_H
13 #define LLVM_FUZZER_DICTIONARY_H
29 void Set(
const uint8_t *
B, uint8_t S) {
37 return Size == w.Size && 0 == memcmp(Data, w.Data, Size);
40 bool operator<(const FixedWord<kMaxSize> &w)
const {
44 return memcmp(Data, w.Data, Size) < 0;
48 const uint8_t *
data()
const {
return Data; }
49 uint8_t
size()
const {
return Size; }
86 size_t SuccessCount = 0;
95 return DE.
GetW() == W;
106 this->DE[Size++] = DE;
109 bool empty()
const {
return Size == 0; }
110 size_t size()
const {
return Size; }
127 #endif // LLVM_FUZZER_DICTIONARY_H
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
bool ParseOneDictionaryEntry(const std::string &Str, Unit *U)
const DictionaryEntry * end() const
size_t GetSuccessCount() const
const uint8_t * data() const
static PassOptionList PrintAfter("print-after", llvm::cl::desc("Print IR after specified passes"), cl::Hidden)
bool operator==(const FixedWord< kMaxSize > &w) const
DictionaryEntry(Word W, size_t PositionHint)
bool HasPositionHint() const
PrintASCII(Dict[i].data(), Dict[i].size(),"\"")
bool ParseDictionaryFile(const std::string &Text, std::vector< Unit > *Units)
void Set(const uint8_t *B, uint8_t S)
bool any_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
DictionaryEntry & operator[](size_t Idx)
void push_back(DictionaryEntry DE)
const DictionaryEntry * begin() const
bool ContainsWord(const Word &W) const
size_t GetUseCount() const
static const size_t kMaxSize
size_t GetPositionHint() const
static const size_t kMaxDictSize
std::vector< uint8_t > Unit
FixedWord(const uint8_t *B, uint8_t S)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Printf(" # Score: %d, Used: %d\n", Scores[i], Usages[i])
const Word & GetW() const
void Print(const char *PrintAfter="\n")
static size_t GetMaxSize()