Make canonicalization of ImmutableSetRef::asImmutableSet() semi-explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140959 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/ADT/ImmutableSet.h b/include/llvm/ADT/ImmutableSet.h
index 8e2fea5..d597a7c 100644
--- a/include/llvm/ADT/ImmutableSet.h
+++ b/include/llvm/ADT/ImmutableSet.h
@@ -1145,8 +1145,9 @@
return Root ? Root->contains(V) : false;
}
- ImmutableSet<ValT> asImmutableSet() const {
- return ImmutableSet<ValT>(Factory->getCanonicalTree(Root));
+ ImmutableSet<ValT> asImmutableSet(bool canonicalize = true) const {
+ return ImmutableSet<ValT>(canonicalize ?
+ Factory->getCanonicalTree(Root) : Root);
}
TreeTy *getRootWithoutRetain() const {