summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/Interval.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-25 03:54:14 +0000
committerChris Lattner <sabre@nondot.org>2001-06-25 03:54:14 +0000
commit4dd88f6fbf6dc44ceba03b34aeab458536789b98 (patch)
treeede31689254f3fb9e823f94eaa24b416825cc7e2 /include/llvm/Analysis/Interval.h
parentd6a7b7552f5cc0a254b2faaf91451d85870ca7dd (diff)
downloadllvm-4dd88f6fbf6dc44ceba03b34aeab458536789b98.tar.gz
llvm-4dd88f6fbf6dc44ceba03b34aeab458536789b98.tar.bz2
llvm-4dd88f6fbf6dc44ceba03b34aeab458536789b98.tar.xz
Big changes. Interval*.h is now more or less finalized. IntervalPartition
is recoded to use IntervalIterators. IntervalIterators can now maintain their own memory or let an external entity do it. Loop depth is a new user of IntervalPartition for calculating the loop nesting depth of a basic block TODO: add IntervalPartition capability to split intervals between the looping portion and the "tail" portion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/Interval.h')
-rw-r--r--include/llvm/Analysis/Interval.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Analysis/Interval.h b/include/llvm/Analysis/Interval.h
index 33f7d4182c..1d708b691c 100644
--- a/include/llvm/Analysis/Interval.h
+++ b/include/llvm/Analysis/Interval.h
@@ -39,6 +39,9 @@ public:
Nodes.push_back(Header);
}
+ inline Interval(const Interval &I) // copy ctor
+ : HeaderNode(I.HeaderNode), Nodes(I.Nodes), Successors(I.Successors) {}
+
inline BasicBlock *getHeaderNode() const { return HeaderNode; }
// Nodes - The basic blocks in this interval.
@@ -74,6 +77,14 @@ public:
//return find(Successors.begin(), Successors.end(), BB) != Successors.end();
}
+ // Equality operator. It is only valid to compare two intervals from the same
+ // partition, because of this, all we have to check is the header node for
+ // equality.
+ //
+ inline bool operator==(const Interval &I) const {
+ return HeaderNode == I.HeaderNode;
+ }
+
// isLoop - Find out if there is a back edge in this interval...
bool isLoop() const;
};