Deleted Added
full compact
ImmutableMap.h (218893) ImmutableMap.h (219077)
1//===--- ImmutableMap.h - Immutable (functional) map interface --*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 94 unchanged lines hidden (view full) ---

103 : Canonicalize(canonicalize) {}
104
105 Factory(BumpPtrAllocator& Alloc, bool canonicalize = true)
106 : F(Alloc), Canonicalize(canonicalize) {}
107
108 ImmutableMap getEmptyMap() { return ImmutableMap(F.getEmptyTree()); }
109
110 ImmutableMap add(ImmutableMap Old, key_type_ref K, data_type_ref D) {
1//===--- ImmutableMap.h - Immutable (functional) map interface --*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 94 unchanged lines hidden (view full) ---

103 : Canonicalize(canonicalize) {}
104
105 Factory(BumpPtrAllocator& Alloc, bool canonicalize = true)
106 : F(Alloc), Canonicalize(canonicalize) {}
107
108 ImmutableMap getEmptyMap() { return ImmutableMap(F.getEmptyTree()); }
109
110 ImmutableMap add(ImmutableMap Old, key_type_ref K, data_type_ref D) {
111 TreeTy *T = F.add(Old.Root, std::make_pair<key_type,data_type>(K,D));
111 TreeTy *T = F.add(Old.Root, std::pair(K,D));
112 return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T);
113 }
114
115 ImmutableMap remove(ImmutableMap Old, key_type_ref K) {
116 TreeTy *T = F.remove(Old.Root,K);
117 return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T);
118 }
119

--- 142 unchanged lines hidden ---
112 return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T);
113 }
114
115 ImmutableMap remove(ImmutableMap Old, key_type_ref K) {
116 TreeTy *T = F.remove(Old.Root,K);
117 return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T);
118 }
119

--- 142 unchanged lines hidden ---