summaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/ImmutableSet.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-10-10 23:47:03 +0000
committerTed Kremenek <kremenek@apple.com>2007-10-10 23:47:03 +0000
commit37474bce024c4a1e85dd777a8b489af60eb4c699 (patch)
tree0d44f516bb507a3d61b586431d750401c195f877 /include/llvm/ADT/ImmutableSet.h
parentac6084dfc22042da72b5170f52e3ceaad978fcff (diff)
downloadexternal_llvm-37474bce024c4a1e85dd777a8b489af60eb4c699.zip
external_llvm-37474bce024c4a1e85dd777a8b489af60eb4c699.tar.gz
external_llvm-37474bce024c4a1e85dd777a8b489af60eb4c699.tar.bz2
Added some doxygen comments to ImmutableSet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42850 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ImmutableSet.h')
-rw-r--r--include/llvm/ADT/ImmutableSet.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h
index 7434967..a0a28df 100644
--- a/include/llvm/ADT/ImmutableSet.h
+++ b/include/llvm/ADT/ImmutableSet.h
@@ -791,12 +791,27 @@ public:
public:
Factory() {}
+ /// GetEmptySet - Returns an immutable set that contains no elements.
ImmutableSet GetEmptySet() { return ImmutableSet(F.GetEmptyTree()); }
+ /// Add - Creates a new immutable set that contains all of the values
+ /// of the original set with the addition of the specified value. If
+ /// the original set already included the value, then the original set is
+ /// returned and no memory is allocated. The time and space complexity
+ /// of this operation is logarithmic in the size of the original set.
+ /// The memory allocated to represent the set is released when the
+ /// factory object that created the set is destroyed.
ImmutableSet Add(ImmutableSet Old, value_type_ref V) {
return ImmutableSet(F.Add(Old.Root,V));
}
+ /// Remove - Creates a new immutable set that contains all of the values
+ /// of the original set with the exception of the specified value. If
+ /// the original set did not contain the value, the original set is
+ /// returned and no memory is allocated. The time and space complexity
+ /// of this operation is logarithmic in the size of the original set.
+ /// The memory allocated to represent the set is released when the
+ /// factory object that created the set is destroyed.
ImmutableSet Remove(ImmutableSet Old, value_type_ref V) {
return ImmutableSet(F.Remove(Old.Root,V));
}
@@ -807,7 +822,8 @@ public:
};
friend class Factory;
-
+
+ /// contains - Returns true if the set contains the specified value.
bool contains(const value_type_ref V) const {
return Root ? Root->contains(V) : false;
}
@@ -820,6 +836,7 @@ public:
return Root && RHS.Root ? Root->isNotEqual(*RHS.Root) : Root != RHS.Root;
}
+ /// isEmpty - Return true if the set contains no elements.
bool isEmpty() const { return !Root; }
template <typename Callback>