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

Function count_functions

test/reduce/remove_function_test.cpp:27–34  ·  view source on GitHub ↗

Helper to count the number of functions in the module. Remove if there turns out to be a more direct way to do this.

Source from the content-addressed store, hash-verified

25// Helper to count the number of functions in the module.
26// Remove if there turns out to be a more direct way to do this.
27uint32_t count_functions(opt::IRContext* context) {
28 uint32_t result = 0;
29 for (auto& function : *context->module()) {
30 (void)(function);
31 ++result;
32 }
33 return result;
34}
35
36TEST(RemoveFunctionTest, BasicCheck) {
37 std::string shader = R"(

Callers 1

TESTFunction · 0.85

Calls 1

moduleMethod · 0.45

Tested by

no test coverage detected