[llvm] 0bc7665 - [ADT] Fix FoldingSet documentation typos

Brian Gesiak via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 27 18:28:13 PST 2019


Author: Brian Gesiak
Date: 2019-12-27T21:27:59-05:00
New Revision: 0bc7665d988218d7c9a907e52f0e1c7fc01601a2

URL: https://github.com/llvm/llvm-project/commit/0bc7665d988218d7c9a907e52f0e1c7fc01601a2
DIFF: https://github.com/llvm/llvm-project/commit/0bc7665d988218d7c9a907e52f0e1c7fc01601a2.diff

LOG: [ADT] Fix FoldingSet documentation typos

* "If found then M with be non-NULL" should be "will be non-NULL".
* The documentation examples (1) and (2) declare and use a variable
  `MyNode *M`, but examples (3) and (4) switch midway to using a
  variable named `N`. Unify the examples to all use `M`.
* The examples demonstrate the use of member functions of
  `FoldingSet`, but (3) and (4) invoke these as if they were free
  functions. Modify them to call member functions on the `MyFoldingSet`
  object constructed in the code above example (1).

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/FoldingSet.h b/llvm/include/llvm/ADT/FoldingSet.h
index d5837e51bcfc..4968b1ea7780 100644
--- a/llvm/include/llvm/ADT/FoldingSet.h
+++ b/llvm/include/llvm/ADT/FoldingSet.h
@@ -85,17 +85,17 @@ namespace llvm {
 ///
 ///    MyNode *M = MyFoldingSet.FindNodeOrInsertPos(ID, InsertPoint);
 ///
-/// If found then M with be non-NULL, else InsertPoint will point to where it
+/// If found then M will be non-NULL, else InsertPoint will point to where it
 /// should be inserted using InsertNode.
 ///
-/// 3) If you get a NULL result from FindNodeOrInsertPos then you can as a new
-/// node with FindNodeOrInsertPos;
+/// 3) If you get a NULL result from FindNodeOrInsertPos then you can insert a
+/// new node with InsertNode;
 ///
-///    InsertNode(N, InsertPoint);
+///    MyFoldingSet.InsertNode(M, InsertPoint);
 ///
 /// 4) Finally, if you want to remove a node from the folding set call;
 ///
-///    bool WasRemoved = RemoveNode(N);
+///    bool WasRemoved = MyFoldingSet.RemoveNode(M);
 ///
 /// The result indicates whether the node existed in the folding set.
 


        


More information about the llvm-commits mailing list