LLVM 23.0.0git
PointerUnion.h File Reference

This file defines the PointerUnion class, which is a discriminated union of pointer types. More...

#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <optional>

Go to the source code of this file.

Classes

struct  llvm::pointer_union_detail::TagEntry
 Tag descriptor for one type in the union. More...
class  llvm::pointer_union_detail::PointerUnionMembers< Derived, Idx >
class  llvm::pointer_union_detail::PointerUnionMembers< Derived, Idx, Type, Types... >
class  llvm::PointerUnion< PTs >
 A discriminated union of two or more pointer types, with the discriminator in the low bits of the pointer. More...
struct  llvm::CastInfo< To, PointerUnion< PTs... > >
struct  llvm::CastInfo< To, const PointerUnion< PTs... > >
struct  llvm::PointerLikeTypeTraits< PointerUnion< PTs... > >
struct  llvm::DenseMapInfo< PointerUnion< PTs... > >

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::pointer_union_detail

Functions

constexpr int llvm::pointer_union_detail::bitsRequired (unsigned NumValues)
 Determine the number of bits required to store values in [0, NumValues).
template<typename... Ts>
constexpr int llvm::pointer_union_detail::lowBitsAvailable ()
template<typename... PTs>
constexpr bool llvm::pointer_union_detail::useFixedWidthTags ()
 True if all types have enough low bits for a fixed-width tag.
template<typename... PTs>
constexpr bool llvm::pointer_union_detail::typesInNonDecreasingBitOrder ()
 True if types are in non-decreasing NumLowBitsAvailable order.
template<typename... PTs>
constexpr std::array< TagEntry, sizeof...(PTs)> llvm::pointer_union_detail::computeFixedTags ()
 Compute fixed-width tag table (all types have enough bits for the tag).
template<typename... PTs>
constexpr std::optional< std::array< TagEntry, sizeof...(PTs)> > llvm::pointer_union_detail::computeExtendedTags ()
 Compute variable-width tag table, or return std::nullopt if the types don't fit.

Detailed Description

This file defines the PointerUnion class, which is a discriminated union of pointer types.

Definition in file PointerUnion.h.