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

Method isTargetMethodInvocation

lib/rootdefanalysis/RDAnalyzer.cpp:882–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880}
881
882bool RDAnalyzer::isTargetMethodInvocation(const RDNode &Node,
883 const llvm::CallBase &CB) {
884
885 // CallBase should call non static method invocation.
886 if (!isNonStaticMethodInvocation(CB))
887 return false;
888
889 // Getting an argument index of the instance of a class.
890 unsigned ClsIndex = 0;
891 if (CB.hasStructRetAttr())
892 ClsIndex += 1;
893 auto *Arg = CB.getArgOperand(ClsIndex);
894
895 // Checks the instance of a class is same as the tracing target.
896 auto Targets = RDTarget::create(*Arg, &Space);
897 if (std::find_if(Targets.begin(), Targets.end(), [&Node](const auto &Src) {
898 return Node.getTarget() == *Src;
899 }) == Targets.end())
900 return false;
901
902 return true;
903}
904
905bool RDAnalyzer::isNonStaticMethodInvocation(const llvm::CallBase &CB) const {
906

Callers

nothing calls this directly

Calls 3

find_ifFunction · 0.85
beginMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected