[llvm-commits] [llvm] r108192 - /llvm/trunk/include/llvm/ADT/FoldingSet.h

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Jul 12 13:47:08 PDT 2010


Author: akirtzidis
Date: Mon Jul 12 15:47:08 2010
New Revision: 108192

URL: http://llvm.org/viewvc/llvm-project?rev=108192&view=rev
Log:
Add convenience method FoldingSetImpl::InsertNode(Node *N) that asserts if the node is already inserted.

Modified:
    llvm/trunk/include/llvm/ADT/FoldingSet.h

Modified: llvm/trunk/include/llvm/ADT/FoldingSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/FoldingSet.h?rev=108192&r1=108191&r2=108192&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/FoldingSet.h (original)
+++ llvm/trunk/include/llvm/ADT/FoldingSet.h Mon Jul 12 15:47:08 2010
@@ -166,6 +166,14 @@
   /// 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; }
 





More information about the llvm-commits mailing list