MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / find_dangling_reference

Method find_dangling_reference

src/module.cpp:859–874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857static bool is_dangling(instruction_ref ins) { return not is_global(ins) and is_borrowed(ins); }
858
859instruction_ref module::find_dangling_reference() const
860{
861 auto last = std::prev(end());
862 if(last->name() == "@return")
863 {
864 auto dangling = std::find_if(
865 last->inputs().begin(), last->inputs().end(), [](auto x) { return is_dangling(x); });
866 if(dangling != last->inputs().end())
867 return *dangling;
868 }
869 else if(is_dangling(last))
870 {
871 return last;
872 }
873 return end();
874}
875
876void module::finalize(std::vector<context>& contexts)
877{

Callers 1

compileMethod · 0.80

Calls 7

endFunction · 0.85
is_danglingFunction · 0.85
find_ifFunction · 0.50
nameMethod · 0.45
beginMethod · 0.45
inputsMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected