Skip to content

Commit

Permalink
[dom] Remove extraneous inline keywords. Template functions and inline
Browse files Browse the repository at this point in the history
class members are implicitly "inline", no key word needed.

Naturally, this could change how LLVM inlines these functions because
<GRR>, but that's not an excuse to use the keyword. ;]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225939 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chandlerc committed Jan 14, 2015
1 parent 35854cb commit cf0dee8
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions include/llvm/Support/GenericDomTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ template <class NodeT> class DominatorBase {
protected:
std::vector<NodeT *> Roots;
const bool IsPostDominators;
inline explicit DominatorBase(bool isPostDom)
explicit DominatorBase(bool isPostDom)
: Roots(), IsPostDominators(isPostDom) {}

public:
/// getRoots - Return the root blocks of the current CFG. This may include
/// multiple blocks if we are computing post dominators. For forward
/// dominators, this will always be a single block (the entry node).
///
inline const std::vector<NodeT *> &getRoots() const { return Roots; }
const std::vector<NodeT *> &getRoots() const { return Roots; }

/// isPostDominator - Returns true if analysis based of postdoms
///
Expand Down Expand Up @@ -140,8 +140,7 @@ template <class NodeT> class DomTreeNodeBase {
};

template <class NodeT>
inline raw_ostream &operator<<(raw_ostream &o,
const DomTreeNodeBase<NodeT> *Node) {
raw_ostream &operator<<(raw_ostream &o, const DomTreeNodeBase<NodeT> *Node) {
if (Node->getBlock())
Node->getBlock()->printAsOperand(o, false);
else
Expand All @@ -153,8 +152,8 @@ inline raw_ostream &operator<<(raw_ostream &o,
}

template <class NodeT>
inline void PrintDomTree(const DomTreeNodeBase<NodeT> *N, raw_ostream &o,
unsigned Lev) {
void PrintDomTree(const DomTreeNodeBase<NodeT> *N, raw_ostream &o,
unsigned Lev) {
o.indent(2 * Lev) << "[" << Lev << "] " << N;
for (typename DomTreeNodeBase<NodeT>::const_iterator I = N->begin(),
E = N->end();
Expand Down Expand Up @@ -324,13 +323,11 @@ template <class NodeT> class DominatorTreeBase : public DominatorBase<NodeT> {
/// getNode - return the (Post)DominatorTree node for the specified basic
/// block. This is the same as using operator[] on this class.
///
inline DomTreeNodeBase<NodeT> *getNode(NodeT *BB) const {
DomTreeNodeBase<NodeT> *getNode(NodeT *BB) const {
return DomTreeNodes.lookup(BB);
}

inline DomTreeNodeBase<NodeT> *operator[](NodeT *BB) const {
return getNode(BB);
}
DomTreeNodeBase<NodeT> *operator[](NodeT *BB) const { return getNode(BB); }

/// getRootNode - This returns the entry node for the CFG of the function. If
/// this tree represents the post-dominance relations for a function, however,
Expand Down Expand Up @@ -380,15 +377,13 @@ template <class NodeT> class DominatorTreeBase : public DominatorBase<NodeT> {
return isReachableFromEntry(getNode(const_cast<NodeT *>(A)));
}

inline bool isReachableFromEntry(const DomTreeNodeBase<NodeT> *A) const {
return A;
}
bool isReachableFromEntry(const DomTreeNodeBase<NodeT> *A) const { return A; }

/// dominates - Returns true iff A dominates B. Note that this is not a
/// constant time operation!
///
inline bool dominates(const DomTreeNodeBase<NodeT> *A,
const DomTreeNodeBase<NodeT> *B) const {
bool dominates(const DomTreeNodeBase<NodeT> *A,
const DomTreeNodeBase<NodeT> *B) const {
// A node trivially dominates itself.
if (B == A)
return true;
Expand Down Expand Up @@ -662,9 +657,9 @@ template <class NodeT> class DominatorTreeBase : public DominatorBase<NodeT> {
return this->DomTreeNodes[BB] = IDomNode->addChild(C);
}

inline NodeT *getIDom(NodeT *BB) const { return IDoms.lookup(BB); }
NodeT *getIDom(NodeT *BB) const { return IDoms.lookup(BB); }

inline void addRoot(NodeT *BB) { this->Roots.push_back(BB); }
void addRoot(NodeT *BB) { this->Roots.push_back(BB); }

public:
/// recalculate - compute a dominator tree for the given function
Expand Down

0 comments on commit cf0dee8

Please sign in to comment.