16 #ifndef LLVM_ADT_OPTIONAL_H
17 #define LLVM_ADT_OPTIONAL_H
24 #if LLVM_HAS_RVALUE_REFERENCES
38 new (storage.buffer)
T(y);
42 new (storage.buffer)
T(*O);
45 #if LLVM_HAS_RVALUE_REFERENCES
47 new (storage.buffer)
T(std::forward<T>(y));
49 Optional(Optional<T> &&O) : hasVal(O) {
51 new (storage.buffer)
T(std::move(*O));
57 **
this = std::move(y);
59 new (storage.buffer)
T(std::move(y));
68 *
this = std::move(*O);
88 new (storage.buffer)
T(y);
113 const T*
getPointer()
const { assert(hasVal);
return reinterpret_cast<const T*
>(storage.buffer); }
114 T*
getPointer() { assert(hasVal);
return reinterpret_cast<T*
>(storage.buffer); }
125 #if LLVM_HAS_RVALUE_REFERENCE_THIS
131 template <
typename T>
struct isPodLike;
143 template<
typename T,
typename U>
152 template<
typename T,
typename U>
161 template<
typename T,
typename U>
170 template<
typename T,
typename U>
179 template<
typename T,
typename U>
188 template<
typename T,
typename U>
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 ...
void operator>(const Optional< T > &X, const Optional< U > &Y)
Poison comparison between two Optional objects. Clients needs to explicitly compare the underlying va...
T & getValue() LLVM_LVALUE_FUNCTION
#define LLVM_LVALUE_FUNCTION
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
void operator>=(const Optional< T > &X, const Optional< U > &Y)
Poison comparison between two Optional objects. Clients needs to explicitly compare the underlying va...
Optional(const Optional &O)
bool operator!=(uint64_t V1, const APInt &V2)
#define LLVM_EXPLICIT
Expands to explicit on compilers which support explicit conversion operators. Otherwise expands to no...
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
bool operator==(uint64_t V1, const APInt &V2)
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")
Optional & operator=(const Optional &O)