diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-02 22:10:37 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-02 22:10:37 -0800 |
commit | b6a01caa64aaac2e5db8d7953a81cbe1a139b81f (patch) | |
tree | 1e03e63b8c985d3b1ca515ac811a87e31e6afef0 /llvm/unittests/CodeGen/MachineInstrTest.cpp | |
parent | b25362816d731ca2283b3b21ca7343a64c05d85c (diff) | |
download | llvm-b6a01caa64aaac2e5db8d7953a81cbe1a139b81f.zip llvm-b6a01caa64aaac2e5db8d7953a81cbe1a139b81f.tar.gz llvm-b6a01caa64aaac2e5db8d7953a81cbe1a139b81f.tar.bz2 |
[llvm/unittests] 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/unittests/CodeGen/MachineInstrTest.cpp')
-rw-r--r-- | llvm/unittests/CodeGen/MachineInstrTest.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/unittests/CodeGen/MachineInstrTest.cpp b/llvm/unittests/CodeGen/MachineInstrTest.cpp index 19e46075..9313bb6 100644 --- a/llvm/unittests/CodeGen/MachineInstrTest.cpp +++ b/llvm/unittests/CodeGen/MachineInstrTest.cpp @@ -271,8 +271,8 @@ TEST(MachineInstrExtraInfo, AddExtraInfo) { MMOs.push_back(MMO); MCSymbol *Sym1 = MC->createTempSymbol("pre_label", false); MCSymbol *Sym2 = MC->createTempSymbol("post_label", false); - MDNode *HAM = MDNode::getDistinct(Ctx, None); - MDNode *PCS = MDNode::getDistinct(Ctx, None); + MDNode *HAM = MDNode::getDistinct(Ctx, std::nullopt); + MDNode *PCS = MDNode::getDistinct(Ctx, std::nullopt); ASSERT_TRUE(MI->memoperands_empty()); ASSERT_FALSE(MI->getPreInstrSymbol()); @@ -331,8 +331,8 @@ TEST(MachineInstrExtraInfo, ChangeExtraInfo) { MMOs.push_back(MMO); MCSymbol *Sym1 = MC->createTempSymbol("pre_label", false); MCSymbol *Sym2 = MC->createTempSymbol("post_label", false); - MDNode *HAM = MDNode::getDistinct(Ctx, None); - MDNode *PCS = MDNode::getDistinct(Ctx, None); + MDNode *HAM = MDNode::getDistinct(Ctx, std::nullopt); + MDNode *PCS = MDNode::getDistinct(Ctx, std::nullopt); MI->setMemRefs(*MF, MMOs); MI->setPreInstrSymbol(*MF, Sym1); @@ -373,8 +373,8 @@ TEST(MachineInstrExtraInfo, RemoveExtraInfo) { MMOs.push_back(MMO); MCSymbol *Sym1 = MC->createTempSymbol("pre_label", false); MCSymbol *Sym2 = MC->createTempSymbol("post_label", false); - MDNode *HAM = MDNode::getDistinct(Ctx, None); - MDNode *PCS = MDNode::getDistinct(Ctx, None); + MDNode *HAM = MDNode::getDistinct(Ctx, std::nullopt); + MDNode *PCS = MDNode::getDistinct(Ctx, std::nullopt); MI->setMemRefs(*MF, MMOs); MI->setPreInstrSymbol(*MF, Sym1); @@ -451,8 +451,8 @@ MATCHER_P(HasMIMetadata, MIMD, "") { TEST(MachineInstrBuilder, BuildMI) { LLVMContext Ctx; - MDNode *PCS = MDNode::getDistinct(Ctx, None); - MDNode *DI = MDNode::getDistinct(Ctx, None); + MDNode *PCS = MDNode::getDistinct(Ctx, std::nullopt); + MDNode *DI = MDNode::getDistinct(Ctx, std::nullopt); DebugLoc DL(DI); MIMetadata MIMD(DL, PCS); EXPECT_EQ(MIMD.getDL(), DL); |