aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-16 22:59:24 +0000
committerChris Lattner <sabre@nondot.org>2010-04-16 22:59:24 +0000
commitf6cedaca9247a43ac4bb229e7a48b475b8513c1f (patch)
tree9efd414ed538e7e1d2bde28cc02841c0f056deb4 /include/llvm
parentc61e47be5e32afdf4c4a0115390eda01a76d597a (diff)
downloadexternal_llvm-f6cedaca9247a43ac4bb229e7a48b475b8513c1f.zip
external_llvm-f6cedaca9247a43ac4bb229e7a48b475b8513c1f.tar.gz
external_llvm-f6cedaca9247a43ac4bb229e7a48b475b8513c1f.tar.bz2
move ReplaceNode out of line, rename scc_iterator::fini -> isAtEnd().
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/ADT/SCCIterator.h8
-rw-r--r--include/llvm/CallGraphSCCPass.h10
2 files changed, 5 insertions, 13 deletions
diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h
index d4f5e5a..3159406 100644
--- a/include/llvm/ADT/SCCIterator.h
+++ b/include/llvm/ADT/SCCIterator.h
@@ -138,11 +138,11 @@ public:
typedef scc_iterator<GraphT, GT> _Self;
// Provide static "constructors"...
- static inline _Self begin(const GraphT& G) { return _Self(GT::getEntryNode(G)); }
- static inline _Self end (const GraphT& G) { return _Self(); }
+ static inline _Self begin(const GraphT &G){return _Self(GT::getEntryNode(G));}
+ static inline _Self end (const GraphT &G) { return _Self(); }
- // Direct loop termination test (I.fini() is more efficient than I == end())
- inline bool fini() const {
+ // Direct loop termination test: I.isAtEnd() is more efficient than I == end()
+ inline bool isAtEnd() const {
assert(!CurrentSCC.empty() || VisitStack.empty());
return CurrentSCC.empty();
}
diff --git a/include/llvm/CallGraphSCCPass.h b/include/llvm/CallGraphSCCPass.h
index 3cff8f2..e11b967 100644
--- a/include/llvm/CallGraphSCCPass.h
+++ b/include/llvm/CallGraphSCCPass.h
@@ -93,15 +93,7 @@ public:
/// ReplaceNode - This informs the SCC and the pass manager that the specified
/// Old node has been deleted, and New is to be used in its place.
- void ReplaceNode(CallGraphNode *Old, CallGraphNode *New) {
- assert(Old != New && "Should not replace node with self");
- for (unsigned i = 0, e = Nodes.size(); i != e; ++i)
- if (Nodes[i] == Old) {
- Nodes[i] = New;
- return;
- }
- assert(0 && "Node not in SCC");
- }
+ void ReplaceNode(CallGraphNode *Old, CallGraphNode *New);
typedef std::vector<CallGraphNode*>::const_iterator iterator;
iterator begin() const { return Nodes.begin(); }