aboutsummaryrefslogtreecommitdiff
path: root/source/validate.h
diff options
context:
space:
mode:
authorUmar Arshad <umar@arrayfire.com>2016-07-13 18:57:52 -0400
committerDavid Neto <dneto@google.com>2016-07-26 16:09:16 -0400
commitefc782d743372b374796d5df3cb233291b686d52 (patch)
tree5080dd7f1c397c6319b99f5fe9a6c3e5c4f82b61 /source/validate.h
parent66c94928a324efd7d3c2d10817e8fb599096302b (diff)
downloadspirv-tools-efc782d743372b374796d5df3cb233291b686d52.tar.gz
Check definitions appear in dominator of use
Also address use and def of ID in same instruction
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 7f411198..225d0c3e 100644
--- a/source/validate.h
+++ b/source/validate.h
@@ -88,6 +88,18 @@ std::vector<std::pair<BasicBlock*, BasicBlock*>> CalculateDominators(
/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_CFG otherwise
spv_result_t PerformCfgChecks(ValidationState_t& _);
+/// @brief This function checks all ID definitions dominate their use in the
+/// CFG.
+///
+/// This function will iterate over all ID definitions that are defined in the
+/// functions of a module and make sure that the definitions appear in a
+/// block that dominates their use.
+///
+/// @param[in] _ the validation state of the module
+///
+/// @return SPV_SUCCESS if no errors are found. SPV_ERROR_INVALID_ID otherwise
+spv_result_t CheckIdDefinitionDominateUse(const 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