llvm::ValueIsPresent

ValueIsPresent provides a way to check if a value is, well, present. For pointers, this is the equivalent of checking against nullptr, for Optionals this is the equivalent of checking hasValue(). It also provides a method for unwrapping a value (think calling .value() on an optional).

Synopsis

Declared in <llvm/Support/Casting.h>

template<
    typename T,
    typename Enable = void>
struct ValueIsPresent;

Type Aliases

NameDescription
UnwrappedType Underlying value type after unwrapping presence wrappers.

Static Member Functions

NameDescription
isPresent Always true for non-nullable value types.
unwrapValue Returns t unchanged.

Specializations

NameDescription
ValueIsPresent<DIExpression::ExprOperand> Treat a default-constructed expression operand as absent.
ValueIsPresent<T>
ValueIsPresent<std::optional<T>>