diff options
author | Kazu Hirata <kazu@google.com> | 2023-01-02 18:56:09 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-01-02 18:56:09 -0800 |
commit | 5273219e57a85ea360639e21d2fcc8b3edc429f5 (patch) | |
tree | b1ed1a1bc8fd29b1615bbeaada8f73c82f8fe53b /mlir/lib/ExecutionEngine/OptUtils.cpp | |
parent | fbc86973b58d7fe735596dfbe38884bc9398e52c (diff) | |
download | llvm-5273219e57a85ea360639e21d2fcc8b3edc429f5.tar.gz |
[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
Diffstat (limited to 'mlir/lib/ExecutionEngine/OptUtils.cpp')
-rw-r--r-- | mlir/lib/ExecutionEngine/OptUtils.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mlir/lib/ExecutionEngine/OptUtils.cpp b/mlir/lib/ExecutionEngine/OptUtils.cpp index a7203055e65f..69216c57c286 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 <optional> using namespace llvm; -static Optional<OptimizationLevel> mapToLevel(unsigned optLevel, - unsigned sizeLevel) { +static std::optional<OptimizationLevel> mapToLevel(unsigned optLevel, + unsigned sizeLevel) { switch (optLevel) { case 0: return OptimizationLevel::O0; @@ -55,7 +56,7 @@ std::function<Error(Module *)> mlir::makeOptimizingTransformer(unsigned optLevel, unsigned sizeLevel, TargetMachine *targetMachine) { return [optLevel, sizeLevel, targetMachine](Module *m) -> Error { - Optional<OptimizationLevel> ol = mapToLevel(optLevel, sizeLevel); + std::optional<OptimizationLevel> ol = mapToLevel(optLevel, sizeLevel); if (!ol) { return make_error<StringError>( formatv("invalid optimization/size level {0}/{1}", optLevel, |