summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mlir/lib/ExecutionEngine/OptUtils.cpp7
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,