| 1041 | } |
| 1042 | |
| 1043 | bool 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 | |
| 1062 | void IRContext::CollectCallTreeFromRoots(unsigned entryId, |
| 1063 | std::unordered_set<uint32_t>* funcs) { |
no test coverage detected