summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-17 09:40:13 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-17 09:40:13 +0000
commitcad56cba1f6cb6009b03cc9e703ac5eb0cef6e10 (patch)
treed5c5b11919bbb159ec6f4a0a472af07530fe5f4b /include
parentc95ce87c237796ffba0d53aa4d9927cb380cd7ce (diff)
downloadllvm-cad56cba1f6cb6009b03cc9e703ac5eb0cef6e10.tar.gz
llvm-cad56cba1f6cb6009b03cc9e703ac5eb0cef6e10.tar.bz2
llvm-cad56cba1f6cb6009b03cc9e703ac5eb0cef6e10.tar.xz
[LCG] Move the call graph node class into the graph class's definition.
This will become necessary to build up the SCC iterators and SCC definitions. Moving it now so that subsequent diffs are incremental. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/LazyCallGraph.h76
1 files changed, 38 insertions, 38 deletions
diff --git a/include/llvm/Analysis/LazyCallGraph.h b/include/llvm/Analysis/LazyCallGraph.h
index f3c2ed9c1d..faf9348f71 100644
--- a/include/llvm/Analysis/LazyCallGraph.h
+++ b/include/llvm/Analysis/LazyCallGraph.h
@@ -166,6 +166,44 @@ public:
}
};
+ /// \brief A node in the call graph.
+ ///
+ /// This represents a single node. It's primary roles are to cache the list of
+ /// callees, de-duplicate and provide fast testing of whether a function is
+ /// a callee, and facilitate iteration of child nodes in the graph.
+ class Node {
+ friend class LazyCallGraph;
+
+ LazyCallGraph *G;
+ Function &F;
+ mutable NodeVectorT Callees;
+ SmallPtrSet<Function *, 4> CalleeSet;
+
+ /// \brief Basic constructor implements the scanning of F into Callees and
+ /// CalleeSet.
+ Node(LazyCallGraph &G, Function &F);
+
+ /// \brief Constructor used when copying a node from one graph to another.
+ Node(LazyCallGraph &G, const Node &OtherN);
+
+ /// \brief Constructor used when moving a node from one graph to another.
+ Node(LazyCallGraph &G, Node &&OtherN);
+
+ public:
+ typedef LazyCallGraph::iterator iterator;
+
+ Function &getFunction() const {
+ return F;
+ };
+
+ iterator begin() const { return iterator(*G, Callees); }
+ iterator end() const { return iterator(*G, Callees, iterator::IsAtEndT()); }
+
+ /// Equality is defined as address equality.
+ bool operator==(const Node &N) const { return this == &N; }
+ bool operator!=(const Node &N) const { return !operator==(N); }
+ };
+
/// \brief Construct a graph for the given module.
///
/// This sets up the graph and computes all of the entry points of the graph.
@@ -232,44 +270,6 @@ private:
Node *copyInto(const Node &OtherN);
};
-/// \brief A node in the call graph.
-///
-/// This represents a single node. It's primary roles are to cache the list of
-/// callees, de-duplicate and provide fast testing of whether a function is
-/// a callee, and facilitate iteration of child nodes in the graph.
-class LazyCallGraph::Node {
- friend class LazyCallGraph;
-
- LazyCallGraph *G;
- Function &F;
- mutable NodeVectorT Callees;
- SmallPtrSet<Function *, 4> CalleeSet;
-
- /// \brief Basic constructor implements the scanning of F into Callees and
- /// CalleeSet.
- Node(LazyCallGraph &G, Function &F);
-
- /// \brief Constructor used when copying a node from one graph to another.
- Node(LazyCallGraph &G, const Node &OtherN);
-
- /// \brief Constructor used when moving a node from one graph to another.
- Node(LazyCallGraph &G, Node &&OtherN);
-
-public:
- typedef LazyCallGraph::iterator iterator;
-
- Function &getFunction() const {
- return F;
- };
-
- iterator begin() const { return iterator(*G, Callees); }
- iterator end() const { return iterator(*G, Callees, iterator::IsAtEndT()); }
-
- /// Equality is defined as address equality.
- bool operator==(const Node &N) const { return this == &N; }
- bool operator!=(const Node &N) const { return !operator==(N); }
-};
-
// Provide GraphTraits specializations for call graphs.
template <> struct GraphTraits<LazyCallGraph::Node *> {
typedef LazyCallGraph::Node NodeType;