diff options
Diffstat (limited to 'llvm/lib/Frontend/OpenMP/OMPContext.cpp')
-rw-r--r-- | llvm/lib/Frontend/OpenMP/OMPContext.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/Frontend/OpenMP/OMPContext.cpp b/llvm/lib/Frontend/OpenMP/OMPContext.cpp index 0f846f7bfee5..50ca01d34e20 100644 --- a/llvm/lib/Frontend/OpenMP/OMPContext.cpp +++ b/llvm/lib/Frontend/OpenMP/OMPContext.cpp @@ -163,19 +163,19 @@ static int isVariantApplicableInContextHelper( // context based on the match kind selected by the user via // `implementation={extensions(match_[all,any,none])}' auto HandleTrait = [MK](TraitProperty Property, - bool WasFound) -> Optional<bool> /* Result */ { + bool WasFound) -> std::optional<bool> /* Result */ { // For kind "any" a single match is enough but we ignore non-matched // properties. if (MK == MK_ANY) { if (WasFound) return true; - return None; + return std::nullopt; } // In "all" or "none" mode we accept a matching or non-matching property // respectively and move on. We are not done yet! if ((WasFound && MK == MK_ALL) || (!WasFound && MK == MK_NONE)) - return None; + return std::nullopt; // We missed a property, provide some debug output and indicate failure. LLVM_DEBUG({ @@ -212,9 +212,8 @@ static int isVariantApplicableInContextHelper( return Ctx.matchesISATrait(RawString); }); - Optional<bool> Result = HandleTrait(Property, IsActiveTrait); - if (Result) - return Result.value(); + if (std::optional<bool> Result = HandleTrait(Property, IsActiveTrait)) + return *Result; } if (!DeviceSetOnly) { @@ -233,9 +232,8 @@ static int isVariantApplicableInContextHelper( if (ConstructMatches) ConstructMatches->push_back(ConstructIdx - 1); - Optional<bool> Result = HandleTrait(Property, FoundInOrder); - if (Result) - return Result.value(); + if (std::optional<bool> Result = HandleTrait(Property, FoundInOrder)) + return *Result; if (!FoundInOrder) { LLVM_DEBUG(dbgs() << "[" << DEBUG_TYPE << "] Construct property " |