Make canonicalization of ImmutableSetRef::asImmutableSet() semi-explicit.
authorTed Kremenek <kremenek@apple.com>
Sun, 2 Oct 2011 01:47:07 +0000 (01:47 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 2 Oct 2011 01:47:07 +0000 (01:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140959 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ImmutableSet.h

index 8e2fea565879021abf33c4f259bdbaf2c0c6a3ff..d597a7c9be72c5734b79b2219af4faf567c43c80 100644 (file)
@@ -1145,8 +1145,9 @@ public:
     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 {