TailIt = std::copy(Info.Tail.rbegin(), Info.Tail.rend(), TailIt);
// Prepare next recursion level
Pack = Info.Pack;
- CurrentFunction = Info.PackTarget.getValueOr(nullptr);
+ CurrentFunction = Info.PackTarget.value_or(nullptr);
Depth++;
// If we are recursing into a previously encountered function: Abort
if (CurrentFunction) {
auto StatusString = debugString(Result.getStatus());
auto Solution = Result.getSolution();
- auto SolutionString =
- Solution.hasValue() ? "\n" + debugString(Solution.value()) : "";
+ auto SolutionString = Solution ? "\n" + debugString(Solution.value()) : "";
return formatv(
Template,
unsigned Idx = 0;
if (CE->getType()->isArrayType()) {
- Idx = getIndexOfElementToConstruct(State, CE, LCtx).getValueOr(0u);
+ Idx = getIndexOfElementToConstruct(State, CE, LCtx).value_or(0u);
State = setIndexOfElementToConstruct(State, CE, LCtx, Idx + 1);
}
// We try to use cgroup filtering whenever possible
Optional<int> cgroup_fd;
- if (!request.disable_cgroup_filtering.getValueOr(false))
+ if (!request.disable_cgroup_filtering.value_or(false))
cgroup_fd = GetCGroupFileDescriptor(m_process.GetID());
if (Expected<IntelPTProcessTraceUP> trace =
if (use_type_size_for_value && type_sp->GetType()) {
DWARFExpression *location = location_list.GetMutableExpressionAtAddress();
- location->UpdateValue(
- const_value_form.Unsigned(),
- type_sp->GetType()->GetByteSize(nullptr).getValueOr(0),
- die.GetCU()->GetAddressByteSize());
+ location->UpdateValue(const_value_form.Unsigned(),
+ type_sp->GetType()->GetByteSize(nullptr).value_or(0),
+ die.GetCU()->GetAddressByteSize());
}
return std::make_shared<Variable>(
template <typename To, typename From>
struct CastIsPossible<To, Optional<From>> {
static inline bool isPossible(const Optional<From> &f) {
- assert(f.hasValue() && "CastIsPossible::isPossible called on a nullopt!");
+ assert(f && "CastIsPossible::isPossible called on a nullopt!");
return isa_impl_wrap<
To, const From,
typename simplify_type<const From>::SimpleType>::doit(*f);
static Reloc::Model getEffectiveRelocModel(const Triple &TT,
Optional<Reloc::Model> RM) {
- if (!RM.hasValue())
- return Reloc::Static;
- return *RM;
+ return RM.value_or(Reloc::Static);
}
LoongArchTargetMachine::LoongArchTargetMachine(
}
/// Returns true if this switch has a value yet.
- bool hasValue() const { return result.hasValue(); }
+ bool hasValue() const { return result.has_value(); }
/// Return the result of the switch.
LLVM_NODISCARD operator ResultT() {
diag << "expected either lhsIndex=" << lhsIndex
<< " or rhsIndex=" << rhsIndex << " to be nonnegative";
});
- // getValueOr(-1) means that we tolerate a dimension not appearing
+ // value_or(-1) means that we tolerate a dimension not appearing
// in the result map. That can't happen for actual parallel iterators, but
// the caller ContractionOpLowering::matchAndRewrite is currently calling
// lowerParallel also for the case of unit-size reduction dims appearing only
// on one of LHS or RHS, not both. At the moment, such cases are created by
// CastAwayContractionLeadingOneDim, so we need to either support that or
// modify that pattern.
- int64_t resIndex = getResultIndex(iMap[2], iterIndex).getValueOr(-1);
+ int64_t resIndex = getResultIndex(iMap[2], iterIndex).value_or(-1);
if (resIndex == -1 && dimSize != 1)
return rewriter.notifyMatchFailure(op, [&](Diagnostic &diag) {
diag << "expected the dimension for iterIndex=" << iterIndex
SmallVector<AffineMap, 4> iMap = op.getIndexingMaps();
Optional<int64_t> lookupLhs = getResultIndex(iMap[0], iterIndex);
Optional<int64_t> lookupRhs = getResultIndex(iMap[1], iterIndex);
- if (!lookupLhs.hasValue())
+ if (!lookupLhs.has_value())
return rewriter.notifyMatchFailure(op, [&](Diagnostic &diag) {
diag << "expected iterIndex=" << iterIndex << "to map to a LHS dimension";
});
- if (!lookupRhs.hasValue())
+ if (!lookupRhs.has_value())
return rewriter.notifyMatchFailure(op, [&](Diagnostic &diag) {
diag << "expected iterIndex=" << iterIndex << "to map to a RHS dimension";
});