aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/IntrinsicInst.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-12-02 20:05:20 -0800
committerKazu Hirata <kazu@google.com>2022-12-02 20:05:20 -0800
commite842c06c2d52ae1d60db7ed528ea3f4215a0aad6 (patch)
tree2fa4d17e05b9dec6d22fddb83293ebb43b0dfc7d /llvm/lib/IR/IntrinsicInst.cpp
parent19aff0f37dd68ee51e78b764c0ce629ae73d1eef (diff)
downloadllvm-e842c06c2d52ae1d60db7ed528ea3f4215a0aad6.zip
llvm-e842c06c2d52ae1d60db7ed528ea3f4215a0aad6.tar.gz
llvm-e842c06c2d52ae1d60db7ed528ea3f4215a0aad6.tar.bz2
[IR] 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/IR/IntrinsicInst.cpp')
-rw-r--r--llvm/lib/IR/IntrinsicInst.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp
index 2cdebae..242ddc4 100644
--- a/llvm/lib/IR/IntrinsicInst.cpp
+++ b/llvm/lib/IR/IntrinsicInst.cpp
@@ -282,7 +282,7 @@ Optional<RoundingMode> ConstrainedFPIntrinsic::getRoundingMode() const {
if (MAV)
MD = MAV->getMetadata();
if (!MD || !isa<MDString>(MD))
- return None;
+ return std::nullopt;
return convertStrToRoundingMode(cast<MDString>(MD)->getString());
}
@@ -294,7 +294,7 @@ ConstrainedFPIntrinsic::getExceptionBehavior() const {
if (MAV)
MD = MAV->getMetadata();
if (!MD || !isa<MDString>(MD))
- return None;
+ return std::nullopt;
return convertStrToExceptionBehavior(cast<MDString>(MD)->getString());
}
@@ -415,7 +415,7 @@ void VPIntrinsic::setVectorLengthParam(Value *NewEVL) {
Optional<unsigned> VPIntrinsic::getMaskParamPos(Intrinsic::ID IntrinsicID) {
switch (IntrinsicID) {
default:
- return None;
+ return std::nullopt;
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS) \
case Intrinsic::VPID: \
@@ -428,7 +428,7 @@ Optional<unsigned>
VPIntrinsic::getVectorLengthParamPos(Intrinsic::ID IntrinsicID) {
switch (IntrinsicID) {
default:
- return None;
+ return std::nullopt;
#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS) \
case Intrinsic::VPID: \
@@ -461,7 +461,7 @@ Optional<unsigned> VPIntrinsic::getMemoryPointerParamPos(Intrinsic::ID VPID) {
#define END_REGISTER_VP_INTRINSIC(VPID) break;
#include "llvm/IR/VPIntrinsics.def"
}
- return None;
+ return std::nullopt;
}
/// \return The data (payload) operand of this store or scatter.
@@ -481,7 +481,7 @@ Optional<unsigned> VPIntrinsic::getMemoryDataParamPos(Intrinsic::ID VPID) {
#define END_REGISTER_VP_INTRINSIC(VPID) break;
#include "llvm/IR/VPIntrinsics.def"
}
- return None;
+ return std::nullopt;
}
bool VPIntrinsic::isVPIntrinsic(Intrinsic::ID ID) {
@@ -506,7 +506,7 @@ Optional<unsigned> VPIntrinsic::getFunctionalOpcodeForVP(Intrinsic::ID ID) {
#define END_REGISTER_VP_INTRINSIC(VPID) break;
#include "llvm/IR/VPIntrinsics.def"
}
- return None;
+ return std::nullopt;
}
Intrinsic::ID VPIntrinsic::getForOpcode(unsigned IROPC) {
@@ -717,7 +717,7 @@ Optional<unsigned> VPReductionIntrinsic::getVectorParamPos(Intrinsic::ID ID) {
default:
break;
}
- return None;
+ return std::nullopt;
}
Optional<unsigned> VPReductionIntrinsic::getStartParamPos(Intrinsic::ID ID) {
@@ -729,7 +729,7 @@ Optional<unsigned> VPReductionIntrinsic::getStartParamPos(Intrinsic::ID ID) {
default:
break;
}
- return None;
+ return std::nullopt;
}
Instruction::BinaryOps BinaryOpIntrinsic::getBinaryOp() const {