aboutsummaryrefslogtreecommitdiff
path: root/source/validate.h
diff options
context:
space:
mode:
authorJeremy Hayes <jeremy@lunarg.com>2018-01-25 16:32:01 -0700
committerDavid Neto <dneto@google.com>2018-02-01 14:10:55 -0500
commitcd68f2b17642a76ed8f76b233ffce76f777be55a (patch)
tree05e5b74f5bb771cc485a7ac6b0459e43d06f6a99 /source/validate.h
parent905536c5195bf311a55b8e8d22757cdb31502660 (diff)
downloadspirv-tools-cd68f2b17642a76ed8f76b233ffce76f777be55a.tar.gz
Add adjacency validation pass
Validate OpPhi predecessors. Validate OpLoopMerge successors. Validate OpSelectionMerge successors. Fix collateral damage to existing tests. Remove ValidateIdWithMessage.OpSampledImageUsedInOpPhiBad.
Diffstat (limited to 'source/validate.h')
-rw-r--r--source/validate.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/validate.h b/source/validate.h
index a1ea297c..5871b2f2 100644
--- a/source/validate.h
+++ b/source/validate.h
@@ -63,6 +63,18 @@ spv_result_t UpdateIdUse(ValidationState_t& _);
/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_ID otherwise
spv_result_t CheckIdDefinitionDominateUse(const ValidationState_t& _);
+/// @brief This function checks for preconditions involving the adjacent
+/// instructions.
+///
+/// This function will iterate over all instructions and check for any required
+/// predecessor and/or successor instructions. e.g. SpvOpPhi must only be
+/// preceeded by SpvOpLabel, SpvOpPhi, or SpvOpLine.
+///
+/// @param[in] _ the validation state of the module
+///
+/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_DATA otherwise
+spv_result_t ValidateAdjacency(ValidationState_t& _);
+
/// @brief Updates the immediate dominator for each of the block edges
///
/// Updates the immediate dominator of the blocks for each of the edges