16 #ifndef LLVM_ADT_OPTIONAL_H 17 #define LLVM_ADT_OPTIONAL_H 30 namespace optional_detail {
44 new (storage.
buffer)
T(std::forward<T>(y));
48 new (storage.
buffer)
T(std::move(*
O.getPointer()));
56 new (storage.
buffer)
T(std::move(y));
65 *
this = std::move(*
O.getPointer());
103 return reinterpret_cast<T *
>(storage.
buffer);
107 return reinterpret_cast<const T *
>(storage.
buffer);
111 #if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this. 121 *
reinterpret_cast<T *
>(storage.
buffer) = y;
147 Storage = std::move(y);
153 template <
typename... ArgTypes>
void emplace(ArgTypes &&...
Args) {
189 template <
typename U>
191 return hasValue() ? getValue() : std::forward<U>(value);
194 #if LLVM_HAS_RVALUE_REFERENCE_THIS 195 T &&getValue() && {
return std::move(*
getPointer()); }
198 template <
typename U>
199 T getValueOr(U &&value) && {
200 return hasValue() ? std::move(getValue()) : std::forward<U>(value);
210 template <
typename T,
typename U>
217 template <
typename T,
typename U>
222 template <
typename T,
typename U>
226 return X.hasValue() < Y.hasValue();
229 template <
typename T,
typename U>
234 template <
typename T,
typename U>
239 template <
typename T,
typename U>
264 template <
typename T>
bool operator<(const Optional<T> &
X,
NoneType) {
268 template <
typename T>
bool operator<(NoneType, const Optional<T> &
X) {
272 template <
typename T>
bool operator<=(const Optional<T> &
X,
NoneType) {
276 template <
typename T>
bool operator<=(NoneType, const Optional<T> &
X) {
312 template <
typename T>
bool operator<(const Optional<T> &
X,
const T &
Y) {
316 template <
typename T>
bool operator<(const T &X, const Optional<T> &
Y) {
320 template <
typename T>
bool operator<=(const Optional<T> &
X,
const T &
Y) {
324 template <
typename T>
bool operator<=(const T &X, const Optional<T> &
Y) {
346 #endif // LLVM_ADT_OPTIONAL_H
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
const T & operator*() const LLVM_LVALUE_FUNCTION
Compute iterated dominance frontiers using a linear time algorithm.
OptionalStorage & operator=(OptionalStorage &&O)
OptionalStorage(OptionalStorage &&O)
NoneType
A simple null object to allow implicit construction of Optional<T> and similar types without having t...
bool operator>(int64_t V1, const APSInt &V2)
constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION
void emplace(ArgTypes &&... Args)
Create a new object by constructing it in place with the given arguments.
block Block Frequency true
#define LLVM_LVALUE_FUNCTION
Expands to '&' if ref-qualifiers for *this are supported.
OptionalStorage & operator=(T &&y)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
T & getValue() LLVM_LVALUE_FUNCTION
bool operator>=(int64_t V1, const APSInt &V2)
OptionalStorage & operator=(const T &y)
OptionalStorage()=default
Optional & operator=(const T &y)
APInt operator*(APInt a, uint64_t RHS)
AlignedCharArrayUnion< T > storage
const T & getValue() const LLVM_LVALUE_FUNCTION
const T * getPointer() const
const T * operator->() const
OptionalStorage(const OptionalStorage &O)
static Optional create(const T *y)
T & operator*() LLVM_LVALUE_FUNCTION
const T * getPointer() const
constexpr Optional(NoneType)
isPodLike - This is a type trait that is used to determine whether a given type can be copied around ...
OptionalStorage & operator=(const T &y)
bool operator!=(uint64_t V1, const APInt &V2)
OptionalStorage(const T &y)
OptionalStorage & operator=(const OptionalStorage &O)
Optional & operator=(T &&y)
OptionalStorage(const T &y)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
AlignedCharArrayUnion< T > storage
bool operator==(uint64_t V1, const APInt &V2)
constexpr char Args[]
Key for Kernel::Metadata::mArgs.