diff options
author | Hans-Kristian Arntzen <hans-kristian.arntzen@arm.com> | 2016-11-18 18:45:11 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <hans-kristian.arntzen@arm.com> | 2016-11-18 18:45:11 +0300 |
commit | 5ff11cc689e119eb3158517115d0aa865da028f5 (patch) | |
tree | 9c4674ad9d7e09173a29325ef9a36fef12d7278a /spirv_cfg.hpp | |
parent | 0c9683cd850f792d54dacc11621e3ba344a30f7f (diff) |
Handle more corner cases with the CFG traversal.
Diffstat (limited to 'spirv_cfg.hpp')
-rw-r--r-- | spirv_cfg.hpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spirv_cfg.hpp b/spirv_cfg.hpp index e94cb229..07eb1196 100644 --- a/spirv_cfg.hpp +++ b/spirv_cfg.hpp @@ -18,6 +18,7 @@ #define SPIRV_CROSS_CFG_HPP #include "spirv_cross.hpp" +#include <assert.h> namespace spirv_cross { @@ -31,14 +32,26 @@ public: return compiler; } + const Compiler &get_compiler() const + { + return compiler; + } + + const SPIRFunction &get_function() const + { + return func; + } + uint32_t get_immediate_dominator(uint32_t block) const { return immediate_dominators[block]; } - uint32_t get_post_order(uint32_t block) const + uint32_t get_visit_order(uint32_t block) const { - return post_order[block]; + int v = visit_order[block]; + assert(v > 0); + return uint32_t(v); } uint32_t find_common_dominator(uint32_t a, uint32_t b) const; @@ -73,6 +86,8 @@ public: return dominator; } + void lift_continue_block_dominator(); + private: const CFG &cfg; uint32_t dominator = 0; |