From c7fa15c0f21b09bb081da9bfb2007d8b2dc703c2 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 25 Nov 2022 23:44:08 -0800 Subject: [PATCH] [IPO] Use std::optional in IROutliner.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 --- llvm/lib/Transforms/IPO/IROutliner.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/IPO/IROutliner.cpp b/llvm/lib/Transforms/IPO/IROutliner.cpp index 1373f14..9f89f32 100644 --- a/llvm/lib/Transforms/IPO/IROutliner.cpp +++ b/llvm/lib/Transforms/IPO/IROutliner.cpp @@ -26,6 +26,7 @@ #include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" #include "llvm/Transforms/IPO.h" +#include #include #define DEBUG_TYPE "iroutliner" @@ -133,7 +134,7 @@ struct OutlinableGroup { /// The argument that needs to be marked with the swifterr attribute. If not /// needed, there is no value. - Optional SwiftErrorArgument; + std::optional SwiftErrorArgument; /// For the \ref Regions, we look at every Value. If it is a constant, /// we check whether it is the same in Region. @@ -2671,7 +2672,7 @@ void IROutliner::updateOutputMapping(OutlinableRegion &Region, LoadInst *LI) { // For and load instructions following the call Value *Operand = LI->getPointerOperand(); - Optional OutputIdx; + std::optional OutputIdx; // Find if the operand it is an output register. for (unsigned ArgIdx = Region.NumExtractedInputs; ArgIdx < Region.Call->arg_size(); ArgIdx++) { -- 2.7.4