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);
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;
153 template <
typename T,
typename U>
160 template <
typename T,
typename U>
165 template <
typename T,
typename U>
169 return X.hasValue() < Y.hasValue();
172 template <
typename T,
typename U>
177 template <
typename T,
typename U>
182 template <
typename T,
typename U>
207 template <
typename T>
bool operator<(const Optional<T> &
X,
NoneType) {
211 template <
typename T>
bool operator<(NoneType, const Optional<T> &
X) {
215 template <
typename T>
bool operator<=(const Optional<T> &
X,
NoneType) {
219 template <
typename T>
bool operator<=(NoneType, const Optional<T> &
X) {
255 template <
typename T>
bool operator<(const Optional<T> &
X,
const T &
Y) {
259 template <
typename T>
bool operator<(const T &X, const Optional<T> &
Y) {
263 template <
typename T>
bool operator<=(const Optional<T> &
X,
const T &
Y) {
267 template <
typename T>
bool operator<=(const T &X, const Optional<T> &
Y) {
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)
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
Function Alias Analysis false
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)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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)