1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Added "getRoot()" to ImmutableSet.

Made ImmutableSet::ImmutableSet(ImutAVLTree* Root) public. (this allows handy
casting between trees and sets).

llvm-svn: 46277
This commit is contained in:
Ted Kremenek 2008-01-23 19:57:33 +00:00
parent a54401ee30
commit d6669b6b8a

View File

@ -862,14 +862,17 @@ class ImmutableSet {
public:
typedef typename ValInfo::value_type value_type;
typedef typename ValInfo::value_type_ref value_type_ref;
private:
typedef ImutAVLTree<ValInfo> TreeTy;
private:
TreeTy* Root;
ImmutableSet(TreeTy* R) : Root(R) {}
public:
/// Constructs a set from a pointer to a tree root. In general one
/// should use a Factory object to create sets instead of directly
/// invoking the constructor, but there are cases where make this
/// constructor public is useful.
explicit ImmutableSet(TreeTy* R) : Root(R) {}
class Factory {
typename TreeTy::Factory F;
@ -924,6 +927,8 @@ public:
return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
}
TreeTy* getRoot() const { return Root; }
/// isEmpty - Return true if the set contains no elements.
bool isEmpty() const { return !Root; }