Changeset View
Changeset View
Standalone View
Standalone View
llvm/include/llvm/Support/GenericDomTree.h
//===- GenericDomTree.h - Generic dominator trees for graphs ----*- C++ -*-===// | //===- GenericDomTree.h - Generic dominator trees for graphs ----*- C++ -*-===// | ||||
Lint: Lint: clang-format not found in user's PATH; not linting file. | |||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
/// \file | /// \file | ||||
▲ Show 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | public: | ||||
bool dominatesBlock(CfgBlockRef A, CfgBlockRef B) const; | bool dominatesBlock(CfgBlockRef A, CfgBlockRef B) const; | ||||
const GenericDomTreeNodeBase * | const GenericDomTreeNodeBase * | ||||
findNearestCommonDominator(const GenericDomTreeNodeBase *A, | findNearestCommonDominator(const GenericDomTreeNodeBase *A, | ||||
const GenericDomTreeNodeBase *B) const; | const GenericDomTreeNodeBase *B) const; | ||||
CfgBlockRef findNearestCommonDominatorBlock(CfgBlockRef A, | CfgBlockRef findNearestCommonDominatorBlock(CfgBlockRef A, | ||||
CfgBlockRef B) const; | CfgBlockRef B) const; | ||||
const GenericDomTreeNodeBase * | |||||
findSiblingOfUncle(const GenericDomTreeNodeBase *A, | |||||
const GenericDomTreeNodeBase *Uncle) const; | |||||
void updateDFSNumbers() const; | void updateDFSNumbers() const; | ||||
private: | private: | ||||
/// Wipe this tree's state without releasing any resources. | /// Wipe this tree's state without releasing any resources. | ||||
/// | /// | ||||
/// This is essentially a post-move helper only. It leaves the object in an | /// This is essentially a post-move helper only. It leaves the object in an | ||||
/// assignable and destroyable state, but otherwise invalid. | /// assignable and destroyable state, but otherwise invalid. | ||||
void wipe() { | void wipe() { | ||||
▲ Show 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | public: | ||||
NodeT *findNearestCommonDominator(NodeT *A, NodeT *B) const { | NodeT *findNearestCommonDominator(NodeT *A, NodeT *B) const { | ||||
assert(A && B && "Pointers are not valid"); | assert(A && B && "Pointers are not valid"); | ||||
const TreeNode *dom = static_cast<const TreeNode *>( | const TreeNode *dom = static_cast<const TreeNode *>( | ||||
GenericDominatorTreeBase::findNearestCommonDominator(getNode(A), | GenericDominatorTreeBase::findNearestCommonDominator(getNode(A), | ||||
getNode(B))); | getNode(B))); | ||||
return dom->getBlock(); | return dom->getBlock(); | ||||
} | } | ||||
const TreeNode *findSiblingOfUncle(const TreeNode *A, | |||||
const TreeNode *Uncle) const { | |||||
return static_cast<const TreeNode *>( | |||||
GenericDominatorTreeBase::findSiblingOfUncle(A, Uncle)); | |||||
} | |||||
//===--------------------------------------------------------------------===// | //===--------------------------------------------------------------------===// | ||||
// API to update (Post)DominatorTree information based on modifications to | // API to update (Post)DominatorTree information based on modifications to | ||||
// the CFG... | // the CFG... | ||||
/// Inform the dominator tree about a sequence of CFG edge insertions and | /// Inform the dominator tree about a sequence of CFG edge insertions and | ||||
/// deletions and perform a batch update on the tree. | /// deletions and perform a batch update on the tree. | ||||
/// | /// | ||||
/// This function should be used when there were multiple CFG updates after | /// This function should be used when there were multiple CFG updates after | ||||
▲ Show 20 Lines • Show All 306 Lines • Show Last 20 Lines |
clang-format not found in user's PATH; not linting file.