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

Function startsWithOp

source/text_handler.cpp:148–154  ·  view source on GitHub ↗

Returns true if the characters in the text as position represent the start of an Opcode.

Source from the content-addressed store, hash-verified

146// Returns true if the characters in the text as position represent
147// the start of an Opcode.
148bool startsWithOp(spv_text text, spv_position position) {
149 if (text->length < position->index + 3) return false;
150 char ch0 = text->str[position->index];
151 char ch1 = text->str[position->index + 1];
152 char ch2 = text->str[position->index + 2];
153 return ('O' == ch0 && 'p' == ch1 && ('A' <= ch2 && ch2 <= 'Z'));
154}
155
156// Returns false if the the floating point encoding requires a bit width
157// different from the given width. Write the expected bit width via *expected.

Callers 2

startsWithOpMethod · 0.85
isStartOfNewInstMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected