MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / ProcessCallTreeFromRoots

Method ProcessCallTreeFromRoots

source/opt/ir_context.cpp:1043–1060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1041}
1042
1043bool IRContext::ProcessCallTreeFromRoots(ProcessFunction& pfn,
1044 std::queue<uint32_t>* roots) {
1045 // Process call tree
1046 bool modified = false;
1047 std::unordered_set<uint32_t> done;
1048
1049 while (!roots->empty()) {
1050 const uint32_t fi = roots->front();
1051 roots->pop();
1052 if (done.insert(fi).second) {
1053 Function* fn = GetFunction(fi);
1054 assert(fn && "Trying to process a function that does not exist.");
1055 modified = pfn(fn) || modified;
1056 AddCalls(fn, roots);
1057 }
1058 }
1059 return modified;
1060}
1061
1062void IRContext::CollectCallTreeFromRoots(unsigned entryId,
1063 std::unordered_set<uint32_t>* funcs) {

Callers 3

CollectUsedVariablesMethod · 0.80
IsRecursiveMethod · 0.80
UpgradeBarriersMethod · 0.80

Calls 4

GetFunctionFunction · 0.85
frontMethod · 0.80
emptyMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected