mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2025-01-16 19:14:14 +00:00
f76e0f5231
Most uses of an ID must occur after the definition of the ID. Forward references are allowed for things like OpName, OpDecorate, and various cases of control-flow instructions such as OpBranch, OpPhi, and OpFunctionCall. TODO: Use CFG analysis for SSA checks. In particular, an ID defined inside a function body is only usable inside that function body. Also, use dominator info to catch some failing cases. Also: * Validator test cases use (standard) assignment form. * Update style to more closely follow the Google C++ style guide * Remove color-diagnostics flag. This is enabled by default on terminals with color. Prints hidden ASCII for terminals that can't handle color(Emacs) * Pass functors to SSAPass to check if the operand can be forward referenced based on its index value * Return SPV_ERROR_INVALID_ID for ID related errors spvBinaryParse returned SPV_ERROR_INVALID_BINARY for all types of errors. Since spvBinaryParse does some ID validation, this was returning inappropriate error codes for some tests. * Common fixture for validation tests. It only runs certian validation passes. * Add a SPV_VALIDATE_SSA_BIT for testing purposes * Fixtures now return error codes * Add OpName support in diag message and unit tests * Binary parsing can fail with invalid ID or invalid binary error code Tests include: * OpDecorate * OpName * OpMemberName * OpBranchConditional * OpSelectionMerge * OpMemberDecorate * OpGroupDecorate * OpDeviceEnqueue * Enable several tests failing in ID validation. |
||
---|---|---|
.. | ||
assembly_grammar.cpp | ||
assembly_grammar.h | ||
binary.cpp | ||
binary.h | ||
diagnostic.cpp | ||
diagnostic.h | ||
disassemble.cpp | ||
endian.cpp | ||
endian.h | ||
ext_inst.cpp | ||
ext_inst.h | ||
instruction.h | ||
opcode.cpp | ||
opcode.h | ||
opcode.inc | ||
opencl_std_ext_inst.inc | ||
operand.cpp | ||
operand.h | ||
print.cpp | ||
print.h | ||
spirv_constant.h | ||
spirv_definition.h | ||
spirv_operands.h | ||
syntax_tables.patch | ||
table.cpp | ||
table.h | ||
text_handler.cpp | ||
text_handler.h | ||
text.cpp | ||
text.h | ||
validate_id.cpp | ||
validate.cpp | ||
validate.h |