From 1adfdab39936e3fe6f4b7bca945f3d46b4b075e3 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 10 Dec 2022 10:40:35 -0800 Subject: [PATCH] [ComplexToLibm] Use std::optional in ComplexToLibm.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 --- mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp b/mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp index fa8db2c..cf98263 100644 --- a/mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp +++ b/mlir/lib/Conversion/ComplexToLibm/ComplexToLibm.cpp @@ -12,6 +12,7 @@ #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" +#include namespace mlir { #define GEN_PASS_DEF_CONVERTCOMPLEXTOLIBM @@ -24,7 +25,7 @@ namespace { // Functor to resolve the function name corresponding to the given complex // result type. struct ComplexTypeResolver { - llvm::Optional operator()(Type type) const { + std::optional operator()(Type type) const { auto complexType = type.cast(); auto elementType = complexType.getElementType(); if (!elementType.isa()) @@ -37,7 +38,7 @@ struct ComplexTypeResolver { // Functor to resolve the function name corresponding to the given float result // type. struct FloatTypeResolver { - llvm::Optional operator()(Type type) const { + std::optional operator()(Type type) const { auto elementType = type.cast(); if (!elementType.isa()) return {}; -- 2.7.4