From: Kazu Hirata Date: Sat, 26 Nov 2022 07:49:50 +0000 (-0800) Subject: [InstCombine] Use std::optional in InstructionCombining.cpp (NFC) X-Git-Tag: upstream/17.0.6~26442 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3da96e0361f5b68340891d443c24d62a97af9767;p=platform%2Fupstream%2Fllvm.git [InstCombine] Use std::optional in InstructionCombining.cpp (NFC) 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 --- diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index ee20520..e63c31b 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -110,6 +110,7 @@ #define DEBUG_TYPE "instcombine" #include "llvm/Transforms/Utils/InstructionWorklist.h" +#include using namespace llvm; using namespace llvm::PatternMatch; @@ -4244,7 +4245,7 @@ bool InstCombinerImpl::run() { // prove that the successor is not executed more frequently than our block. // Return the UserBlock if successful. auto getOptionalSinkBlockForInst = - [this](Instruction *I) -> Optional { + [this](Instruction *I) -> std::optional { if (!EnableCodeSinking) return None;