Lines Matching refs:U
34 void Fuzzer::PrintUnitInASCIIOrTokens(const Unit &U, const char *PrintAfter) { in PrintUnitInASCIIOrTokens() argument
36 PrintASCII(U, PrintAfter); in PrintUnitInASCIIOrTokens()
38 auto T = SubstituteTokens(U); in PrintUnitInASCIIOrTokens()
103 Unit &U = CurrentUnit; in ShuffleAndMinimize() local
106 U.clear(); in ShuffleAndMinimize()
108 U.insert(U.begin(), C.begin() + First, C.begin() + Last); in ShuffleAndMinimize()
109 size_t NewCoverage = RunOne(U); in ShuffleAndMinimize()
112 NewCorpus.push_back(U); in ShuffleAndMinimize()
115 << " L " << U.size() in ShuffleAndMinimize()
124 size_t Fuzzer::RunOne(const Unit &U) { in RunOne() argument
129 Res = RunOneMaximizeFullCoverageSet(U); in RunOne()
131 Res = RunOneMaximizeCoveragePairs(U); in RunOne()
133 Res = RunOneMaximizeTotalCoverage(U); in RunOne()
141 Print(U, "\n"); in RunOne()
154 Unit Fuzzer::SubstituteTokens(const Unit &U) const { in SubstituteTokens()
156 for (auto Idx : U) { in SubstituteTokens()
168 void Fuzzer::ExecuteCallback(const Unit &U) { in ExecuteCallback() argument
170 Callback(U.data(), U.size()); in ExecuteCallback()
172 auto T = SubstituteTokens(U); in ExecuteCallback()
180 size_t Fuzzer::RunOneMaximizeCoveragePairs(const Unit &U) { in RunOneMaximizeCoveragePairs() argument
182 ExecuteCallback(U); in RunOneMaximizeCoveragePairs()
205 size_t Fuzzer::RunOneMaximizeFullCoverageSet(const Unit &U) { in RunOneMaximizeFullCoverageSet() argument
207 ExecuteCallback(U); in RunOneMaximizeFullCoverageSet()
215 size_t Fuzzer::RunOneMaximizeTotalCoverage(const Unit &U) { in RunOneMaximizeTotalCoverage() argument
222 ExecuteCallback(U); in RunOneMaximizeTotalCoverage()
237 void Fuzzer::WriteToOutputCorpus(const Unit &U) { in WriteToOutputCorpus() argument
239 std::string Path = DirPlusFile(Options.OutputCorpus, Hash(U)); in WriteToOutputCorpus()
240 WriteToFile(U, Path); in WriteToOutputCorpus()
245 void Fuzzer::WriteToCrash(const Unit &U, const char *Prefix) { in WriteToCrash() argument
246 std::string Path = Prefix + Hash(U); in WriteToCrash()
247 WriteToFile(U, Path); in WriteToCrash()
253 for (const auto &U : Corpus) in SaveCorpus() local
254 WriteToFile(U, DirPlusFile(Options.OutputCorpus, Hash(U))); in SaveCorpus()
260 size_t Fuzzer::MutateAndTestOne(Unit *U) { in MutateAndTestOne() argument
265 MutateWithDFSan(U); in MutateAndTestOne()
266 Mutate(U, Options.MaxLen); in MutateAndTestOne()
267 size_t NewCoverage = RunOne(*U); in MutateAndTestOne()
269 Corpus.push_back(*U); in MutateAndTestOne()
273 std::cerr << " L: " << U->size(); in MutateAndTestOne()
274 if (U->size() < 30) { in MutateAndTestOne()
276 PrintUnitInASCIIOrTokens(*U, "\t"); in MutateAndTestOne()
277 Print(*U); in MutateAndTestOne()
281 WriteToOutputCorpus(*U); in MutateAndTestOne()