From e712f826b66bb3a361d165f6fe163ca5e0a56064 Mon Sep 17 00:00:00 2001 From: David Neto Date: Fri, 5 Aug 2016 15:20:59 -0400 Subject: [PATCH] Hide implementations of BasicBlock::dominates,postdominates --- source/val/BasicBlock.cpp | 13 +++++++++++++ source/val/BasicBlock.h | 13 ++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/source/val/BasicBlock.cpp b/source/val/BasicBlock.cpp index 645b555..3e95618 100644 --- a/source/val/BasicBlock.cpp +++ b/source/val/BasicBlock.cpp @@ -26,6 +26,7 @@ #include "BasicBlock.h" +#include #include #include @@ -76,6 +77,18 @@ void BasicBlock::RegisterBranchInstruction(SpvOp branch_instruction) { return; } +bool BasicBlock::dominates(const BasicBlock& other) const { + return (this == &other) || + !(other.dom_end() == + std::find(other.dom_begin(), other.dom_end(), this)); +} + +bool BasicBlock::postdominates(const BasicBlock& other) const { + return (this == &other) || + !(other.pdom_end() == + std::find(other.pdom_begin(), other.pdom_end(), this)); +} + BasicBlock::DominatorIterator::DominatorIterator() : current_(nullptr) {} BasicBlock::DominatorIterator::DominatorIterator( diff --git a/source/val/BasicBlock.h b/source/val/BasicBlock.h index dd1014c..21b0e39 100644 --- a/source/val/BasicBlock.h +++ b/source/val/BasicBlock.h @@ -31,7 +31,6 @@ #include -#include #include #include #include @@ -130,19 +129,11 @@ class BasicBlock { /// Returns true if this block dominates the other block. /// Assumes dominators have been computed. - bool dominates(const BasicBlock& other) const { - return (this == &other) || - !(other.dom_end() == - std::find(other.dom_begin(), other.dom_end(), this)); - } + bool dominates(const BasicBlock& other) const; /// Returns true if this block postdominates the other block. /// Assumes dominators have been computed. - bool postdominates(const BasicBlock& other) const { - return (this == &other) || - !(other.pdom_end() == - std::find(other.pdom_begin(), other.pdom_end(), this)); - } + bool postdominates(const BasicBlock& other) const; /// @brief A BasicBlock dominator iterator class /// -- 2.7.4