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

Method updateFieldFlow

lib/propanalysis/ArrayAnalyzer.cpp:442–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442void ArrayAnalyzer::updateFieldFlow(ArgFlow &AF, std::vector<int> Indices) {
443 auto &A = AF.getLLVMArg();
444 auto *T = A.getType();
445 while (isa<llvm::PointerType>(T))
446 T = T->getPointerElementType();
447
448 auto *ST = dyn_cast_or_null<llvm::StructType>(T);
449 if (!ST)
450 return;
451
452 for (unsigned S = 0; S < ST->getNumElements(); ++S) {
453 Indices.push_back(S);
454 if (!Report->has(A, Indices)) {
455 Indices.pop_back();
456 continue;
457 }
458
459 AF.setStruct(ST);
460 auto &FF = AF.getOrCreateFieldFlow(S);
461 auto Value = Report->get(A, Indices);
462 if (Value == ArrayAnalysisReport::NO_ARRAY)
463 FF.setIsArray(false);
464 else
465 FF.setIsArray(true);
466
467 auto FI = FF.getFieldInfo();
468 if (Value >= 0 && FI)
469 FI->SizeFields = {(unsigned)Value};
470 updateFieldFlow(FF, Indices);
471 Indices.pop_back();
472 }
473}
474
475void ArrayAnalyzer::updateDefault(const llvm::Module &M) {
476 if (!Report)

Callers

nothing calls this directly

Calls 6

setStructMethod · 0.80
setIsArrayMethod · 0.80
getFieldInfoMethod · 0.80
getTypeMethod · 0.45
hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected