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

Function GetFunctionFromParameterId

source/fuzz/fuzzer_util.cpp:1040–1052  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1038}
1039
1040opt::Function* GetFunctionFromParameterId(opt::IRContext* ir_context,
1041 uint32_t param_id) {
1042 auto* param_inst = ir_context->get_def_use_mgr()->GetDef(param_id);
1043 assert(param_inst && "Parameter id is invalid");
1044
1045 for (auto& function : *ir_context->module()) {
1046 if (InstructionIsFunctionParameter(param_inst, &function)) {
1047 return &function;
1048 }
1049 }
1050
1051 return nullptr;
1052}
1053
1054uint32_t UpdateFunctionType(opt::IRContext* ir_context, uint32_t function_id,
1055 uint32_t new_function_type_result_id,

Callers 6

IsApplicableMethod · 0.85
ApplyMethod · 0.85
IsApplicableMethod · 0.85
ApplyMethod · 0.85
RemoveParameterFunction · 0.85

Calls 4

GetDefMethod · 0.45
get_def_use_mgrMethod · 0.45
moduleMethod · 0.45

Tested by

no test coverage detected