//===-- llvm/ADT/IntEqClasses.cpp - Equivalence Classes of Integers -------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Equivalence classes for small integers. This is a mapping of the integers // 0 .. N-1 into M equivalence classes numbered 0 .. M-1. // // Initially each integer has its own equivalence class. Classes are joined by // passing a representative member of each class to join(). // // Once the classes are built, compress() will number them 0 .. M-1 and prevent // further changes. // //===----------------------------------------------------------------------===// #include "llvm/ADT/IntEqClasses.h" #include <cassert> usingnamespacellvm; void IntEqClasses::grow(unsigned N) { … } unsigned IntEqClasses::join(unsigned a, unsigned b) { … } unsigned IntEqClasses::findLeader(unsigned a) const { … } void IntEqClasses::compress() { … } void IntEqClasses::uncompress() { … }