#define LLVM_ADT_OPTIONAL_H
#include "llvm/ADT/None.h"
-#include "llvm/Support/Compiler.h"
#include "llvm/Support/AlignOf.h"
+#include "llvm/Support/Compiler.h"
#include <cassert>
-
-#if LLVM_HAS_RVALUE_REFERENCES
#include <utility>
-#endif
namespace llvm {
new (storage.buffer) T(*O);
}
-#if LLVM_HAS_RVALUE_REFERENCES
Optional(T &&y) : hasVal(true) {
new (storage.buffer) T(std::forward<T>(y));
}
}
return *this;
}
-#endif
static inline Optional create(const T* y) {
return y ? Optional(*y) : Optional();
#endif
};
-template<typename T> struct simplify_type;
-
-template <typename T>
-struct simplify_type<const Optional<T> > {
- typedef const T* SimpleType;
- static SimpleType getSimplifiedValue(const Optional<T> &Val) {
- return Val.getPointer();
- }
-};
-
-template <typename T>
-struct simplify_type<Optional<T> >
- : public simplify_type<const Optional<T> > {};
-
template <typename T> struct isPodLike;
template <typename T> struct isPodLike<Optional<T> > {
// An Optional<T> is pod-like if T is.