This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
#include "llvm/ADT/Optional.h"
#include "llvm/Support/MathExtras.h"
#include <limits>
+#include <optional>
namespace llvm {
/// This function is intended to be used as sparingly as possible, since the
/// class provides the full range of operator support required for arithmetic
/// and comparisons.
- Optional<CostType> getValue() const {
+ std::optional<CostType> getValue() const {
if (isValid())
return Value;
return None;