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

Method EntryPointReferences

source/val/validation_state.cpp:1921–1947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1919}
1920
1921std::set<uint32_t> ValidationState_t::EntryPointReferences(uint32_t id) const {
1922 std::set<uint32_t> referenced_entry_points;
1923 const auto inst = FindDef(id);
1924 if (!inst) return referenced_entry_points;
1925
1926 std::vector<const Instruction*> stack;
1927 stack.push_back(inst);
1928 while (!stack.empty()) {
1929 const auto current_inst = stack.back();
1930 stack.pop_back();
1931
1932 if (const auto func = current_inst->function()) {
1933 // Instruction lives in a function, we can stop searching.
1934 const auto function_entry_points = FunctionEntryPoints(func->id());
1935 referenced_entry_points.insert(function_entry_points.begin(),
1936 function_entry_points.end());
1937 } else {
1938 // Instruction is in the global scope, keep searching its uses.
1939 for (auto pair : current_inst->uses()) {
1940 const auto next_inst = pair.first;
1941 stack.push_back(next_inst);
1942 }
1943 }
1944 }
1945
1946 return referenced_entry_points;
1947}
1948
1949std::string ValidationState_t::Disassemble(const Instruction& inst) const {
1950 const spv_parsed_instruction_t& c_inst(inst.c_inst());

Callers 3

Calls 9

backMethod · 0.80
pop_backMethod · 0.80
push_backMethod · 0.45
emptyMethod · 0.45
functionMethod · 0.45
idMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected