diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-03-31 21:54:20 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-03-31 21:54:20 +0000 |
| commit | 1eaae507341bd15b2861c4f32245b5418e5fe69f (patch) | |
| tree | b093558521fbff4dc3d806ed7ca6601324705bab | |
| parent | c9e48c0a3f21f0da42768d52096c61d0b6f5c396 (diff) | |
| download | bcm5719-llvm-1eaae507341bd15b2861c4f32245b5418e5fe69f.tar.gz bcm5719-llvm-1eaae507341bd15b2861c4f32245b5418e5fe69f.zip | |
Add a workaround for building with old versions of clang.
llvm-svn: 153820
| -rw-r--r-- | llvm/include/llvm/Analysis/Dominators.h | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/llvm/include/llvm/Analysis/Dominators.h b/llvm/include/llvm/Analysis/Dominators.h index f2ccb6e9626..204b34ebffc 100644 --- a/llvm/include/llvm/Analysis/Dominators.h +++ b/llvm/include/llvm/Analysis/Dominators.h @@ -346,16 +346,7 @@ public: return dominates(A, B); } - inline bool properlyDominates(const NodeT *A, const NodeT *B) { - if (A == B) - return false; - - // Cast away the const qualifiers here. This is ok since - // this function doesn't actually return the values returned - // from getNode. - return dominates(getNode(const_cast<NodeT *>(A)), - getNode(const_cast<NodeT *>(B))); - } + bool properlyDominates(const NodeT *A, const NodeT *B); bool dominatedBySlowTreeWalk(const DomTreeNodeBase<NodeT> *A, const DomTreeNodeBase<NodeT> *B) const { @@ -429,16 +420,7 @@ public: return dominatedBySlowTreeWalk(A, B); } - inline bool dominates(const NodeT *A, const NodeT *B) { - if (A == B) - return true; - - // Cast away the const qualifiers here. This is ok since - // this function doesn't actually return the values returned - // from getNode. - return dominates(getNode(const_cast<NodeT *>(A)), - getNode(const_cast<NodeT *>(B))); - } + bool dominates(const NodeT *A, const NodeT *B); NodeT *getRoot() const { assert(this->Roots.size() == 1 && "Should always have entry node!"); @@ -704,6 +686,32 @@ public: } }; +// These two functions are declare out of line as a workaround for building +// with old (< r147295) versions of clang because of pr11642. +template<class NodeT> +bool DominatorTreeBase<NodeT>::dominates(const NodeT *A, const NodeT *B) { + if (A == B) + return true; + + // Cast away the const qualifiers here. This is ok since + // this function doesn't actually return the values returned + // from getNode. + return dominates(getNode(const_cast<NodeT *>(A)), + getNode(const_cast<NodeT *>(B))); +} +template<class NodeT> +bool +DominatorTreeBase<NodeT>::properlyDominates(const NodeT *A, const NodeT *B) { + if (A == B) + return false; + + // Cast away the const qualifiers here. This is ok since + // this function doesn't actually return the values returned + // from getNode. + return dominates(getNode(const_cast<NodeT *>(A)), + getNode(const_cast<NodeT *>(B))); +} + EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase<BasicBlock>); //===------------------------------------- |

