[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 9b0906da34b693e5eacb455553d011e2a686e61d..1f20616ac6b4e14344a18574cebeefbfb48669c0 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 9b0906da34b693e5eacb455553d011e2a686e61d..1f20616ac6b4e14344a18574cebeefbfb48669c0 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 9b0906da34b693e5eacb455553d011e2a686e61d..1f20616ac6b4e14344a18574cebeefbfb48669c0 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 9b0906da34b693e5eacb455553d011e2a686e61d..1f20616ac6b4e14344a18574cebeefbfb48669c0 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 9b0906da34b693e5eacb455553d011e2a686e61d..1f20616ac6b4e14344a18574cebeefbfb48669c0 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 9b0906da34b693e5eacb455553d011e2a686e61d..1f20616ac6b4e14344a18574cebeefbfb48669c0 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 abfd2f5635f1f8f7000fac302468987bf92904e5..7ba7b8f8d8e7940c05425ee2c609ec17f7f7b1d0 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 5a562da36a20bfbe4a43e2d3544d632c268fa8c4..470d483cbb5648134145d11fcbeaa896395f25b3 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 38c547078bfcd4b87349a67a740749e604e128f8..98d80f0101527e18fdbc6ff1d9046139cc41c6ad 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 b19315e170974fedaf6ac0809e162bcf98adc646..5f728516ac390d1b968b3c17595cc08cd0878555 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 d0ac1a24b0b892873df965f3e21fdb0f6a863500..07c01579930c39c52961388a7def5f06e53558f7 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 bba002f3621fa74b8dbfe12d966ed842f73f9012..55369c734732a35d85d01931e9102a648b0ab573 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 62dc532587a5f1b8bc7051b3c80d71f7969ad01d..a2b1d97b8629b0ee7d6e621685b16c765d35f378 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 ebb14643cda73cd030ba2d8242f797d224b6deb5..7ee7046a59b509574704a841c83a884e39ae6e4d 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 228f04160c7318a0e30f9a37bc60a56acfac9ff6..61c39bd315f1878ce6ae42d23420bcd1feade978 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 4640e03883615e51857b88a1d7acda98d1a15e07..9cae80fd51da0db245a77911171b39737abfc59e 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 f3370a4f59a0a965ed8d18b5853a89f58bea007f..8caa5a094a78098cbf8e3ba50936d7948d820962 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 a29f16397bd8df6129adf0d59f098a9bfa7cbd4b..c8ede8b06e1e3f4404a9f9e236bcda2d68819823 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 d26fa2077a4d23ef1dedbc609f7dd0d1c3312ab4..37115acbe0665a86d44deb26c352b96cf9f5a336 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 245dc4621b7185f05d48cfeb5e7d5f4f86c9cee2..2d8bbc14cb3b740e234cd5ad30065e2c03273fee 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 3112e9f4cd16a0aa4874dbbdb00645b946594ed5..8818a370e89d9c0040b93afd172c97cf0b26de91 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 fdb5c2a82364dec5d44f3611088ca0a6fc16b849..a51bdb50da9edee0833feaaf9d33f06cf1b56678 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"