[PATCH] D106367: [ADT][NFC] Correct the wrong header comment of ImmutableSet::add_internal

Valeriy Savchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 08:52:31 PDT 2021


vsavchenko added inline comments.


================
Comment at: llvm/include/llvm/ADT/ImmutableSet.h:541-542
   /// add_internal - Creates a new tree that includes the specified
   ///  data and the data from the original tree.  If the original tree
-  ///  already contained the data item, the original tree is returned.
+  ///  already contained the data item, a new tree is returned.
   TreeTy* add_internal(value_type_ref V, TreeTy* T) {
----------------
It looks that it worked that way before, `createNode` (or `Create`, as it was called before) was checking in the cache if we have a tree like this.  Now it's all done higher up the hierarchy of calls in `getCanonicalTree`.
Maybe we should just remove this sentence?  Because why would we mention the case that is actually never covered (and it is not covered because it is talking about the data item not the key).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106367/new/

https://reviews.llvm.org/D106367



More information about the llvm-commits mailing list