From 5273219e57a85ea360639e21d2fcc8b3edc429f5 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 2 Jan 2023 18:56:09 -0800 Subject: [PATCH] [mlir] Use std::optional instead of llvm::Optional (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 --- mlir/lib/ExecutionEngine/OptUtils.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mlir/lib/ExecutionEngine/OptUtils.cpp b/mlir/lib/ExecutionEngine/OptUtils.cpp index a720305..69216c5 100644 --- a/mlir/lib/ExecutionEngine/OptUtils.cpp +++ b/mlir/lib/ExecutionEngine/OptUtils.cpp @@ -20,11 +20,12 @@ #include "llvm/Support/Error.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/Target/TargetMachine.h" +#include using namespace llvm; -static Optional mapToLevel(unsigned optLevel, - unsigned sizeLevel) { +static std::optional mapToLevel(unsigned optLevel, + unsigned sizeLevel) { switch (optLevel) { case 0: return OptimizationLevel::O0; @@ -55,7 +56,7 @@ std::function mlir::makeOptimizingTransformer(unsigned optLevel, unsigned sizeLevel, TargetMachine *targetMachine) { return [optLevel, sizeLevel, targetMachine](Module *m) -> Error { - Optional ol = mapToLevel(optLevel, sizeLevel); + std::optional ol = mapToLevel(optLevel, sizeLevel); if (!ol) { return make_error( formatv("invalid optimization/size level {0}/{1}", optLevel, -- 2.7.4