16 #ifndef LLVM_ADT_OPTIONAL_H
17 #define LLVM_ADT_OPTIONAL_H
38 new (storage.buffer)
T(y);
42 new (storage.buffer)
T(*O);
46 new (storage.buffer)
T(std::forward<T>(y));
50 new (storage.buffer)
T(std::move(*O));
56 **
this = std::move(y);
58 new (storage.buffer)
T(std::move(y));
67 *
this = std::move(*O);
74 template<
typename ...ArgTypes>
78 new (storage.buffer)
T(std::forward<ArgTypes>(Args)...);
94 new (storage.buffer)
T(y);
119 const T*
getPointer()
const { assert(hasVal);
return reinterpret_cast<const T*
>(storage.buffer); }
120 T*
getPointer() { assert(hasVal);
return reinterpret_cast<T*
>(storage.buffer); }
124 explicit operator bool()
const {
return hasVal; }
131 template <
typename U>
136 #if LLVM_HAS_RVALUE_REFERENCE_THIS
140 template <
typename U>
147 template <
typename T>
struct isPodLike;
159 template<
typename T,
typename U>
168 template<
typename T,
typename U>
177 template<
typename T,
typename U>
186 template<
typename T,
typename U>
195 template<
typename T,
typename U>
204 template<
typename T,
typename U>
Optional & operator=(Optional &&O)
const T & operator*() const LLVM_LVALUE_FUNCTION
NoneType
A simple null object to allow implicit construction of Optional<T> and similar types without having to ...
bool operator>(int64_t V1, const APSInt &V2)
LLVM_CONSTEXPR T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION
T & getValue() LLVM_LVALUE_FUNCTION
bool operator>=(int64_t V1, const APSInt &V2)
#define LLVM_LVALUE_FUNCTION
Expands to '&' if ref-qualifiers for *this are supported.
const T * operator->() const
Optional & operator=(const T &y)
const T & getValue() const LLVM_LVALUE_FUNCTION
static Optional create(const T *y)
const T * getPointer() const
T & operator*() LLVM_LVALUE_FUNCTION
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
isPodLike - This is a type trait that is used to determine whether a given type can be copied around ...
Optional(Optional< T > &&O)
Optional(const Optional &O)
bool operator!=(uint64_t V1, const APInt &V2)
Optional & operator=(T &&y)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
bool operator==(uint64_t V1, const APInt &V2)
void emplace(ArgTypes &&...Args)
Create a new object by constructing it in place with the given arguments.
Optional & operator=(const Optional &O)