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

Method getOutParamIndices

lib/rootdefanalysis/RDAnalyzer.cpp:791–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791std::set<size_t> RDAnalyzer::getOutParamIndices(CallBase &CB) const {
792 std::set<size_t> Result;
793
794 // 1. Checks program states.
795 auto *F = CB.getCalledFunction();
796 assert((F && F->isDeclaration()) && "Unexpected Program State");
797
798 // 2. Checks this call has sret attribute.
799 unsigned S = 0;
800 bool HasStructRet = CB.hasStructRetAttr();
801 if (HasStructRet) {
802 Result.insert(0);
803 S = 1;
804 }
805
806 // 3. Collect parameter indices whose direction is output.
807 for (auto E = CB.getNumArgOperands(); S < E; ++S) {
808 if (isOutParam(CB, S))
809 Result.insert(S);
810 }
811 return Result;
812}
813
814std::set<unsigned> RDAnalyzer::getNonOutParamIndices(const CallBase &CB) const {
815

Callers

nothing calls this directly

Calls 1

getCalledFunctionMethod · 0.80

Tested by

no test coverage detected