llvm::ImutAVLFactory::merge_internal

Merges A and B by splitting B at each of A's keys.

Synopsis

Declared in <llvm/ADT/ImmutableSet.h>

template<typename CombineFn>
TreeTy*
merge_internal(
    TreeTy* A,
    TreeTy* B,
    CombineFn& Combine,
    bool KeepUnmatched,
    bool SkipShared);

Description

For a key in both, the stored element is Combine(AElem, BElem). KeepUnmatched controls keys unique to one side: when true, such elements (and whole non-overlapping subtrees) are taken unchanged and shared, and Combine is invoked only on keys present in both (valid when Combine is an identity for a missing side, e.g. a set union or a lattice join with an identity element); when false every key is passed through Combine with the absent side null (needed for a join that transforms unmatched keys, e.g. liveness downgrading Must to Maybe).

Return Value

Root of the merged tree (before recoverNodes).

Parameters

NameDescription
AFirst operand tree.
BSecond operand tree.
CombineCombiner for elements that share a key (and unmatched keys when KeepUnmatched is false).
KeepUnmatchedIf true, share unmatched elements/subtrees as-is.
SkipSharedIf true, return pointer-identical subtrees unchanged.