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

Function spvAlternatePatternFollowingImmediate

source/operand.cpp:466–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466spv_operand_pattern_t spvAlternatePatternFollowingImmediate(
467 const spv_operand_pattern_t& pattern) {
468 auto it =
469 std::find(pattern.crbegin(), pattern.crend(), SPV_OPERAND_TYPE_RESULT_ID);
470 if (it != pattern.crend()) {
471 spv_operand_pattern_t alternatePattern(it - pattern.crbegin() + 2,
472 SPV_OPERAND_TYPE_OPTIONAL_CIV);
473 alternatePattern[1] = SPV_OPERAND_TYPE_RESULT_ID;
474 return alternatePattern;
475 }
476
477 // No result-id found, so just expect CIVs.
478 return {SPV_OPERAND_TYPE_OPTIONAL_CIV};
479}
480
481bool spvIsIdType(spv_operand_type_t type) {
482 switch (type) {

Callers 2

spvTextEncodeOperandFunction · 0.85
TESTFunction · 0.85

Calls 3

findFunction · 0.85
crbeginMethod · 0.80
crendMethod · 0.80

Tested by 1

TESTFunction · 0.68