flang] Remove remaining uses of llvm::Optional (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 8 Jan 2023 06:32:38 +0000 (22:32 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 8 Jan 2023 06:32:38 +0000 (22:32 -0800)
This patch removes the unused "using" declaration and removes #include
"llvm/ADT/Optional.h".

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

flang/include/flang/Lower/CustomIntrinsicCall.h
flang/include/flang/Lower/IntrinsicCall.h
flang/include/flang/Lower/Runtime.h
flang/include/flang/Lower/SymbolMap.h
flang/include/flang/Optimizer/Builder/FIRBuilder.h
flang/lib/Lower/Mangler.cpp
flang/lib/Optimizer/Transforms/AffinePromotion.cpp
flang/lib/Optimizer/Transforms/MemRefDataFlowOpt.cpp
flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp

index bb7e599..391aabd 100644 (file)
@@ -25,7 +25,6 @@
 #define FORTRAN_LOWER_CUSTOMINTRINSICCALL_H
 
 #include "flang/Lower/AbstractConverter.h"
-#include "llvm/ADT/Optional.h"
 #include <functional>
 #include <optional>
 
index 0d404fe..cc4b8f9 100644 (file)
@@ -10,7 +10,6 @@
 #define FORTRAN_LOWER_INTRINSICCALL_H
 
 #include "flang/Optimizer/Builder/FIRBuilder.h"
-#include "llvm/ADT/Optional.h"
 #include <optional>
 
 namespace fir {
index 1c4b98f..0c2a5fd 100644 (file)
 
 #include <optional>
 
-namespace llvm {
-template <typename T> using Optional = std::optional<T>;
-}
-
 namespace mlir {
 class Location;
 class Value;
index f65e551..f6aa586 100644 (file)
@@ -22,7 +22,6 @@
 #include "mlir/IR/Value.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/Compiler.h"
 #include <optional>
index 682b457..5d1f855 100644 (file)
@@ -24,7 +24,6 @@
 #include "mlir/IR/Builders.h"
 #include "mlir/IR/BuiltinOps.h"
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 #include <optional>
 
 namespace fir {
index b4030a0..e0bc7b1 100644 (file)
@@ -14,7 +14,6 @@
 #include "flang/Optimizer/Support/InternalNames.h"
 #include "flang/Semantics/tools.h"
 #include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Twine.h"
index 9fde565..321a078 100644 (file)
@@ -27,7 +27,6 @@
 #include "mlir/IR/Visitors.h"
 #include "mlir/Transforms/DialectConversion.h"
 #include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/Debug.h"
 #include <optional>
 
index 9aad370..cf65453 100644 (file)
@@ -14,7 +14,6 @@
 #include "mlir/IR/Dominance.h"
 #include "mlir/IR/Operation.h"
 #include "mlir/Transforms/Passes.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallVector.h"
 #include <optional>
index 05ddcfe..25f161c 100644 (file)
@@ -37,7 +37,6 @@
 #include "mlir/Transforms/DialectConversion.h"
 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
 #include "mlir/Transforms/RegionUtils.h"
-#include "llvm/ADT/Optional.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include <optional>