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

Method IsRecursive

source/opt/function.cpp:243–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243bool Function::IsRecursive() const {
244 IRContext* ctx = blocks_.front()->GetLabel()->context();
245 IRContext::ProcessFunction mark_visited = [this](Function* fp) {
246 return fp == this;
247 };
248
249 // Process the call tree from all of the function called by |this|. If it get
250 // back to |this|, then we have a recursive function.
251 std::queue<uint32_t> roots;
252 ctx->AddCalls(this, &roots);
253 return ctx->ProcessCallTreeFromRoots(mark_visited, &roots);
254}
255
256std::ostream& operator<<(std::ostream& str, const Function& func) {
257 str << func.PrettyPrint();

Callers 2

IsInlinableFunctionMethod · 0.80
TESTFunction · 0.80

Calls 4

frontMethod · 0.80
AddCallsMethod · 0.80
contextMethod · 0.45

Tested by 1

TESTFunction · 0.64