[mlir] Remove remaining uses of llvm::Optional (NFC)
authorKazu Hirata <kazu@google.com>
Sat, 14 Jan 2023 09:34:49 +0000 (01:34 -0800)
committerKazu Hirata <kazu@google.com>
Sat, 14 Jan 2023 09:34:49 +0000 (01:34 -0800)
This patch removes one "using" declaration and #include
"llvm/ADT/Optional.h".  It keeps several "using" declarations in
headers for downstream users.

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

22 files changed:
mlir/examples/toy/Ch1/include/toy/Parser.h
mlir/examples/toy/Ch2/include/toy/Parser.h
mlir/examples/toy/Ch3/include/toy/Parser.h
mlir/examples/toy/Ch4/include/toy/Parser.h
mlir/examples/toy/Ch5/include/toy/Parser.h
mlir/examples/toy/Ch6/include/toy/Parser.h
mlir/examples/toy/Ch7/include/toy/Parser.h
mlir/include/mlir/Analysis/Presburger/Simplex.h
mlir/include/mlir/Bindings/Python/PybindAdaptors.h
mlir/include/mlir/Dialect/Affine/Analysis/AffineAnalysis.h
mlir/include/mlir/Dialect/Affine/Analysis/LoopAnalysis.h
mlir/include/mlir/ExecutionEngine/MemRefUtils.h
mlir/include/mlir/Pass/PassManager.h
mlir/include/mlir/Support/LogicalResult.h
mlir/lib/Analysis/Presburger/Simplex.cpp
mlir/lib/AsmParser/Token.h
mlir/lib/Bindings/Python/Globals.h
mlir/lib/Bindings/Python/IRAttributes.cpp
mlir/lib/Bindings/Python/IRModule.h
mlir/lib/Bindings/Python/PybindUtils.h
mlir/lib/Tools/lsp-server-support/Protocol.h
mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

index 9b0906d..1f20616 100644 (file)
@@ -17,7 +17,6 @@
 #include "toy/AST.h"
 #include "toy/Lexer.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
index 9b0906d..1f20616 100644 (file)
@@ -17,7 +17,6 @@
 #include "toy/AST.h"
 #include "toy/Lexer.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
index 9b0906d..1f20616 100644 (file)
@@ -17,7 +17,6 @@
 #include "toy/AST.h"
 #include "toy/Lexer.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
index 9b0906d..1f20616 100644 (file)
@@ -17,7 +17,6 @@
 #include "toy/AST.h"
 #include "toy/Lexer.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
index 9b0906d..1f20616 100644 (file)
@@ -17,7 +17,6 @@
 #include "toy/AST.h"
 #include "toy/Lexer.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
index 9b0906d..1f20616 100644 (file)
@@ -17,7 +17,6 @@
 #include "toy/AST.h"
 #include "toy/Lexer.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
index abfd2f5..7ba7b8f 100644 (file)
@@ -17,7 +17,6 @@
 #include "toy/AST.h"
 #include "toy/Lexer.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/raw_ostream.h"
index 5a562da..470d483 100644 (file)
@@ -22,7 +22,6 @@
 #include "mlir/Analysis/Presburger/Utils.h"
 #include "mlir/Support/LogicalResult.h"
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallBitVector.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/StringSaver.h"
index 38c5470..98d80f0 100644 (file)
@@ -25,7 +25,6 @@
 #include "mlir-c/Bindings/Python/Interop.h"
 #include "mlir-c/IR.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/Twine.h"
 
 namespace py = pybind11;
index b19315e..5f72851 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "mlir/Dialect/Arith/IR/Arith.h"
 #include "mlir/IR/Value.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include <optional>
 
index d0ac1a2..07c0157 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "mlir/Support/LLVM.h"
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include <optional>
 
 namespace mlir {
index bba002f..55369c7 100644 (file)
@@ -17,7 +17,6 @@
 #include "mlir/ExecutionEngine/CRunnerUtils.h"
 #include "mlir/Support/LLVM.h"
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 
 #include "llvm/Support/raw_ostream.h"
index 62dc532..a2b1d97 100644 (file)
@@ -13,7 +13,6 @@
 #include "mlir/IR/OperationSupport.h"
 #include "mlir/Support/LogicalResult.h"
 #include "mlir/Support/Timing.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/raw_ostream.h"
index ebb1464..7ee7046 100644 (file)
@@ -10,7 +10,6 @@
 #define MLIR_SUPPORT_LOGICALRESULT_H
 
 #include "mlir/Support/LLVM.h"
-#include "llvm/ADT/Optional.h"
 #include <optional>
 
 namespace mlir {
index 228f041..61c39bd 100644 (file)
@@ -9,7 +9,6 @@
 #include "mlir/Analysis/Presburger/Simplex.h"
 #include "mlir/Analysis/Presburger/Matrix.h"
 #include "mlir/Support/MathExtras.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/Compiler.h"
 #include <numeric>
 #include <optional>
index 4640e03..9cae80f 100644 (file)
@@ -10,7 +10,6 @@
 #define MLIR_LIB_PARSER_TOKEN_H
 
 #include "mlir/Support/LLVM.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/SMLoc.h"
 #include <optional>
index f3370a4..8caa5a0 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "PybindUtils.h"
 
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
 
index a29f163..c8ede8b 100644 (file)
@@ -20,7 +20,6 @@ namespace py = pybind11;
 using namespace mlir;
 using namespace mlir::python;
 
-using llvm::Optional;
 using llvm::SmallVector;
 using llvm::Twine;
 
index d26fa20..37115ac 100644 (file)
@@ -21,7 +21,6 @@
 #include "mlir-c/IR.h"
 #include "mlir-c/IntegerSet.h"
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 
 namespace mlir {
 namespace python {
index 245dc46..2d8bbc1 100644 (file)
@@ -10,7 +10,6 @@
 #define MLIR_BINDINGS_PYTHON_PYBINDUTILS_H
 
 #include "mlir-c/Support.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/DataTypes.h"
 
index 3112e9f..8818a37 100644 (file)
@@ -24,7 +24,6 @@
 #define LIB_MLIR_TOOLS_LSPSERVERSUPPORT_PROTOCOL_H_
 
 #include "mlir/Support/LLVM.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/raw_ostream.h"
index fdb5c2a..a51bdb5 100644 (file)
@@ -20,7 +20,6 @@
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/Support/FileUtilities.h"
 #include "mlir/Support/LLVM.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"