diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-02 21:11:37 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-02 21:11:37 -0800 |
commit | 343de6856e16b58bcbd16d479fc633f54e22fadc (patch) | |
tree | 31e3fbef03aa0e4c5ea9582d0eacc650aba3073d /llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | |
parent | 998960ee1f2c8bc3830df4849ab89ec9d6217f26 (diff) | |
download | llvm-343de6856e16b58bcbd16d479fc633f54e22fadc.zip llvm-343de6856e16b58bcbd16d479fc633f54e22fadc.tar.gz llvm-343de6856e16b58bcbd16d479fc633f54e22fadc.tar.bz2 |
[Transforms] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.
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
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 935c56c..db39544 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -5873,13 +5873,13 @@ InstCombiner::getFlippedStrictnessPredicateAndConstant(CmpInst::Predicate Pred, if (auto *CI = dyn_cast<ConstantInt>(C)) { // Bail out if the constant can't be safely incremented/decremented. if (!ConstantIsOk(CI)) - return llvm::None; + return std::nullopt; } else if (auto *FVTy = dyn_cast<FixedVectorType>(Type)) { unsigned NumElts = FVTy->getNumElements(); for (unsigned i = 0; i != NumElts; ++i) { Constant *Elt = C->getAggregateElement(i); if (!Elt) - return llvm::None; + return std::nullopt; if (isa<UndefValue>(Elt)) continue; @@ -5888,14 +5888,14 @@ InstCombiner::getFlippedStrictnessPredicateAndConstant(CmpInst::Predicate Pred, // know that this constant is min/max. auto *CI = dyn_cast<ConstantInt>(Elt); if (!CI || !ConstantIsOk(CI)) - return llvm::None; + return std::nullopt; if (!SafeReplacementConstant) SafeReplacementConstant = CI; } } else { // ConstantExpr? - return llvm::None; + return std::nullopt; } // It may not be safe to change a compare predicate in the presence of |