From b6a01caa64aaac2e5db8d7953a81cbe1a139b81f Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 2 Dec 2022 22:10:37 -0800 Subject: [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 --- llvm/unittests/IR/InstructionsTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/unittests/IR/InstructionsTest.cpp') diff --git a/llvm/unittests/IR/InstructionsTest.cpp b/llvm/unittests/IR/InstructionsTest.cpp index 26a5139..cd9fb03 100644 --- a/llvm/unittests/IR/InstructionsTest.cpp +++ b/llvm/unittests/IR/InstructionsTest.cpp @@ -752,7 +752,7 @@ TEST(InstructionsTest, AlterCallBundles) { AttrBuilder AB(C); AB.addAttribute(Attribute::Cold); Call->setAttributes(AttributeList::get(C, AttributeList::FunctionIndex, AB)); - Call->setDebugLoc(DebugLoc(MDNode::get(C, None))); + Call->setDebugLoc(DebugLoc(MDNode::get(C, std::nullopt))); OperandBundleDef NewBundle("after", ConstantInt::get(Int32Ty, 7)); std::unique_ptr Clone(CallInst::Create(Call.get(), NewBundle)); @@ -782,7 +782,7 @@ TEST(InstructionsTest, AlterInvokeBundles) { AB.addAttribute(Attribute::Cold); Invoke->setAttributes( AttributeList::get(C, AttributeList::FunctionIndex, AB)); - Invoke->setDebugLoc(DebugLoc(MDNode::get(C, None))); + Invoke->setDebugLoc(DebugLoc(MDNode::get(C, std::nullopt))); OperandBundleDef NewBundle("after", ConstantInt::get(Int32Ty, 7)); std::unique_ptr Clone( -- cgit v1.1