MCPcopy Create free account
hub / github.com/Samsung/UTopia / updateArrayInfo

Method updateArrayInfo

lib/generation/FuzzInput.cpp:326–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void FuzzInputGenerator::updateArrayInfo(
327 std::map<unsigned, std::shared_ptr<FuzzInput>> &FuzzInputMap,
328 const std::vector<std::set<unsigned>> &ArrayGroups) const {
329
330 for (auto &ArrayGroup : ArrayGroups) {
331 const FuzzInput *ArrayDef = nullptr;
332 const FuzzInput *ArrayLenDef = nullptr;
333
334 for (auto &ID : ArrayGroup) {
335 auto Iter = FuzzInputMap.find(ID);
336 assert(Iter != FuzzInputMap.end() && "Unexpected Program State");
337
338 const auto *Input = Iter->second.get();
339 assert(Input && "Unexpected Program State");
340
341 if (Input->getCopyFrom())
342 continue;
343
344 const auto &Def = Input->getDef();
345 if (Def.Array) {
346 if (ArrayDef) {
347 assert(ArrayDef == Input && "Unexpected Program State");
348 }
349 ArrayDef = Input;
350 } else if (Def.ArrayLen) {
351 if (ArrayLenDef) {
352 assert(ArrayLenDef == Input && "Unexpected Program State");
353 }
354 ArrayLenDef = Input;
355 }
356 }
357
358 assert(ArrayDef && "Unexpected Program State");
359 if (!ArrayLenDef)
360 continue;
361
362 const_cast<FuzzInput *>(ArrayDef)->ArrayLenDef = &ArrayLenDef->getDef();
363 const_cast<FuzzInput *>(ArrayLenDef)->ArrayDef = &ArrayDef->getDef();
364 }
365}
366
367NoInputPtr
368FuzzNoInputFactory::generate(std::shared_ptr<const Definition> Def) const {

Callers

nothing calls this directly

Calls 5

endMethod · 0.80
getCopyFromMethod · 0.80
getDefMethod · 0.80
findMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected