From 343de6856e16b58bcbd16d479fc633f54e22fadc Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 2 Dec 2022 21:11:37 -0800 Subject: [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 --- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp') diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index 2d9288b..c03fbe9 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -427,7 +427,7 @@ static bool removeRedundantDbgInstrsUsingForwardScan(BasicBlock *BB) { VariableMap; for (auto &I : *BB) { if (DbgValueInst *DVI = dyn_cast(&I)) { - DebugVariable Key(DVI->getVariable(), None, + DebugVariable Key(DVI->getVariable(), std::nullopt, DVI->getDebugLoc()->getInlinedAt()); auto VMI = VariableMap.find(Key); auto *DAI = dyn_cast(DVI); @@ -488,7 +488,7 @@ static bool remomveUndefDbgAssignsFromEntryBlock(BasicBlock *BB) { DenseSet SeenDefForAggregate; // Returns the DebugVariable for DVI with no fragment info. auto GetAggregateVariable = [](DbgValueInst *DVI) { - return DebugVariable(DVI->getVariable(), None, + return DebugVariable(DVI->getVariable(), std::nullopt, DVI->getDebugLoc()->getInlinedAt()); }; -- cgit v1.1