[IR] Use std::nullopt instead of None (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 4 Dec 2022 23:05:22 +0000 (15:05 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 4 Dec 2022 23:05:22 +0000 (15:05 -0800)
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

llvm/unittests/IR/VPIntrinsicTest.cpp

index 963b1a8..8d1f78d 100644 (file)
@@ -162,7 +162,7 @@ TEST_F(VPIntrinsicTest, VPIntrinsicsDefScopes) {
 #define END_REGISTER_VP_INTRINSIC(VPID)                                        \
   ASSERT_TRUE(ScopeVPID.has_value());                                          \
   ASSERT_EQ(ScopeVPID.value(), Intrinsic::VPID);                               \
-  ScopeVPID = None;
+  ScopeVPID = std::nullopt;
 
   Optional<ISD::NodeType> ScopeOPC;
 #define BEGIN_REGISTER_VP_SDNODE(SDOPC, ...)                                   \
@@ -171,7 +171,7 @@ TEST_F(VPIntrinsicTest, VPIntrinsicsDefScopes) {
 #define END_REGISTER_VP_SDNODE(SDOPC)                                          \
   ASSERT_TRUE(ScopeOPC.has_value());                                           \
   ASSERT_EQ(ScopeOPC.value(), ISD::SDOPC);                                     \
-  ScopeOPC = None;
+  ScopeOPC = std::nullopt;
 #include "llvm/IR/VPIntrinsics.def"
 
   ASSERT_FALSE(ScopeVPID.has_value());