mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Revert "Allow modifying an ImmutableMap without canonicalizing it immediately."
Jordan and I discussed this, and we don't want this in the API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169541 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2766a47310
commit
091508d3d0
@ -96,40 +96,27 @@ public:
|
||||
|
||||
class Factory {
|
||||
typename TreeTy::Factory F;
|
||||
const bool Canonicalizing;
|
||||
const bool Canonicalize;
|
||||
|
||||
public:
|
||||
Factory(bool canonicalize = true)
|
||||
: Canonicalizing(canonicalize) {}
|
||||
: Canonicalize(canonicalize) {}
|
||||
|
||||
Factory(BumpPtrAllocator& Alloc, bool canonicalize = true)
|
||||
: F(Alloc), Canonicalizing(canonicalize) {}
|
||||
: F(Alloc), Canonicalize(canonicalize) {}
|
||||
|
||||
ImmutableMap getEmptyMap() { return ImmutableMap(F.getEmptyTree()); }
|
||||
|
||||
ImmutableMap add(ImmutableMap Old, key_type_ref K, data_type_ref D,
|
||||
bool Canonicalize) {
|
||||
ImmutableMap add(ImmutableMap Old, key_type_ref K, data_type_ref D) {
|
||||
TreeTy *T = F.add(Old.Root, std::pair<key_type,data_type>(K,D));
|
||||
return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T);
|
||||
}
|
||||
|
||||
ImmutableMap add(ImmutableMap Old, key_type_ref K, data_type_ref D) {
|
||||
return add(Old, K, D, Canonicalizing);
|
||||
}
|
||||
|
||||
ImmutableMap remove(ImmutableMap Old, key_type_ref K, bool Canonicalize) {
|
||||
ImmutableMap remove(ImmutableMap Old, key_type_ref K) {
|
||||
TreeTy *T = F.remove(Old.Root,K);
|
||||
return ImmutableMap(Canonicalize ? F.getCanonicalTree(T): T);
|
||||
}
|
||||
|
||||
ImmutableMap remove(ImmutableMap Old, key_type_ref K) {
|
||||
return remove(Old, K, Canonicalizing);
|
||||
}
|
||||
|
||||
ImmutableMap getCanonicalMap(ImmutableMap Map) {
|
||||
return ImmutableMap(F.getCanonicalTree(Map.Root));
|
||||
}
|
||||
|
||||
typename TreeTy::Factory *getTreeFactory() const {
|
||||
return const_cast<typename TreeTy::Factory *>(&F);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user