SPIRV-Tools/source
Umar Arshad f76e0f5231 Basic SSA Validation
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.
2015-12-09 16:15:00 -05:00
..
assembly_grammar.cpp Use opaque context object to hold SPIR-V info tables. 2015-11-12 16:27:51 -05:00
assembly_grammar.h Fix many typos. 2015-11-13 12:35:43 -06:00
binary.cpp Basic SSA Validation 2015-12-09 16:15:00 -05:00
binary.h Use Google comment style and fix typos. 2015-11-16 17:25:43 -05:00
diagnostic.cpp Put DiagnosticStream and clr exports in libspirv namespace 2015-11-20 10:46:42 -05:00
diagnostic.h Put DiagnosticStream and clr exports in libspirv namespace 2015-11-20 10:46:42 -05:00
disassemble.cpp spvBinaryParse: fix overruns, handle image format 2015-11-30 10:44:23 -05:00
endian.cpp Aliasing through a union member is valid. 2015-11-23 15:35:00 -05:00
endian.h spv_parsed_instruction_t cleanup 2015-11-23 09:52:38 -05:00
ext_inst.cpp Add missing copyright. 2015-11-12 09:43:03 -05:00
ext_inst.h Use Google comment style and fix typos. 2015-11-16 17:25:43 -05:00
instruction.h Object files should depend on spirv.h and friends 2015-11-17 18:04:12 -05:00
opcode.cpp OpDecorate should not accept any number of literal operands. 2015-12-01 15:38:32 -05:00
opcode.h Use Google comment style and fix typos. 2015-11-16 17:25:43 -05:00
opcode.inc Update to 1.0 Rev 2 work-in-progress headers 2015-11-12 09:43:12 -05:00
opencl_std_ext_inst.inc Update to 1.0 Rev 2 work-in-progress headers 2015-11-12 09:43:12 -05:00
operand.cpp spvBinaryParse: fix overruns, handle image format 2015-11-30 10:44:23 -05:00
operand.h Use Google comment style and fix typos. 2015-11-16 17:25:43 -05:00
print.cpp Merge pull request #23. 2015-11-23 01:42:46 -05:00
print.h Put DiagnosticStream and clr exports in libspirv namespace 2015-11-20 10:46:42 -05:00
spirv_constant.h Bottom byte of version header word should be 0 2015-11-18 15:19:43 -05:00
spirv_definition.h Support capabilities StorageImageReadWithoutFormat 2015-11-12 16:27:51 -05:00
spirv_operands.h libspirv.h doesn't depend on spirv_operands.hpp anymore. 2015-11-12 09:43:26 -05:00
syntax_tables.patch Add OpenCL extended instructions. 2015-10-26 12:55:33 -04:00
table.cpp Use opaque context object to hold SPIR-V info tables. 2015-11-12 16:27:51 -05:00
table.h Use Google comment style and fix typos. 2015-11-16 17:25:43 -05:00
text_handler.cpp Merge pull request #23. 2015-11-23 01:42:46 -05:00
text_handler.h Fix many typos. 2015-11-13 12:35:43 -06:00
text.cpp spvBinaryParse: fix overruns, handle image format 2015-11-30 10:44:23 -05:00
text.h Use Google comment style and fix typos. 2015-11-16 17:25:43 -05:00
validate_id.cpp Basic SSA Validation 2015-12-09 16:15:00 -05:00
validate.cpp Basic SSA Validation 2015-12-09 16:15:00 -05:00
validate.h Use quotation for libspirv.h and sort headers. 2015-11-12 09:43:01 -05:00