aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-12 20:47:08 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-12 20:47:08 +0000
commitd6afb09a0021aea5789053cbe59fe7550915f6ac (patch)
tree4a27a7898f9dfe5c75566b896bcb8983d4367793 /include/llvm/ADT
parentcfbf0ed8b03bbff5b4045c97dca3f93a4e6b834d (diff)
downloadexternal_llvm-d6afb09a0021aea5789053cbe59fe7550915f6ac.zip
external_llvm-d6afb09a0021aea5789053cbe59fe7550915f6ac.tar.gz
external_llvm-d6afb09a0021aea5789053cbe59fe7550915f6ac.tar.bz2
Add convenience method FoldingSetImpl::InsertNode(Node *N) that asserts if the node is already inserted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108192 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r--include/llvm/ADT/FoldingSet.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/ADT/FoldingSet.h b/include/llvm/ADT/FoldingSet.h
index c03ee5e..fc8490a 100644
--- a/include/llvm/ADT/FoldingSet.h
+++ b/include/llvm/ADT/FoldingSet.h
@@ -166,6 +166,14 @@ public:
/// FindNodeOrInsertPos.
void InsertNode(Node *N, void *InsertPos);
+ /// InsertNode - Insert the specified node into the folding set, knowing that
+ /// it is not already in the folding set.
+ void InsertNode(Node *N) {
+ Node *Inserted = GetOrInsertNode(N);
+ (void)Inserted;
+ assert(Inserted == N && "Node already inserted!");
+ }
+
/// size - Returns the number of nodes in the folding set.
unsigned size() const { return NumNodes; }