[flang-commits] [flang] 0db88db - flang] Remove remaining uses of llvm::Optional (NFC)
Kazu Hirata via flang-commits
flang-commits at lists.llvm.org
Sat Jan 7 22:32:43 PST 2023
Author: Kazu Hirata
Date: 2023-01-07T22:32:38-08:00
New Revision: 0db88db5d90f8d8a76360725597e0dfb82cc9661
URL: https://github.com/llvm/llvm-project/commit/0db88db5d90f8d8a76360725597e0dfb82cc9661
DIFF: https://github.com/llvm/llvm-project/commit/0db88db5d90f8d8a76360725597e0dfb82cc9661.diff
LOG: flang] Remove remaining uses of llvm::Optional (NFC)
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
Added:
Modified:
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
Removed:
################################################################################
diff --git a/flang/include/flang/Lower/CustomIntrinsicCall.h b/flang/include/flang/Lower/CustomIntrinsicCall.h
index bb7e599a4f49..391aabd01721 100644
--- a/flang/include/flang/Lower/CustomIntrinsicCall.h
+++ b/flang/include/flang/Lower/CustomIntrinsicCall.h
@@ -25,7 +25,6 @@
#define FORTRAN_LOWER_CUSTOMINTRINSICCALL_H
#include "flang/Lower/AbstractConverter.h"
-#include "llvm/ADT/Optional.h"
#include <functional>
#include <optional>
diff --git a/flang/include/flang/Lower/IntrinsicCall.h b/flang/include/flang/Lower/IntrinsicCall.h
index 0d404fe9b43b..cc4b8f9e7569 100644
--- a/flang/include/flang/Lower/IntrinsicCall.h
+++ b/flang/include/flang/Lower/IntrinsicCall.h
@@ -10,7 +10,6 @@
#define FORTRAN_LOWER_INTRINSICCALL_H
#include "flang/Optimizer/Builder/FIRBuilder.h"
-#include "llvm/ADT/Optional.h"
#include <optional>
namespace fir {
diff --git a/flang/include/flang/Lower/Runtime.h b/flang/include/flang/Lower/Runtime.h
index 1c4b98f084e1..0c2a5fd4eba3 100644
--- a/flang/include/flang/Lower/Runtime.h
+++ b/flang/include/flang/Lower/Runtime.h
@@ -18,10 +18,6 @@
#include <optional>
-namespace llvm {
-template <typename T> using Optional = std::optional<T>;
-}
-
namespace mlir {
class Location;
class Value;
diff --git a/flang/include/flang/Lower/SymbolMap.h b/flang/include/flang/Lower/SymbolMap.h
index f65e55168edf..f6aa58632396 100644
--- a/flang/include/flang/Lower/SymbolMap.h
+++ b/flang/include/flang/Lower/SymbolMap.h
@@ -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>
diff --git a/flang/include/flang/Optimizer/Builder/FIRBuilder.h b/flang/include/flang/Optimizer/Builder/FIRBuilder.h
index 682b45746bd3..5d1f855f3f56 100644
--- a/flang/include/flang/Optimizer/Builder/FIRBuilder.h
+++ b/flang/include/flang/Optimizer/Builder/FIRBuilder.h
@@ -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 {
diff --git a/flang/lib/Lower/Mangler.cpp b/flang/lib/Lower/Mangler.cpp
index b4030a05e769..e0bc7b18aec7 100644
--- a/flang/lib/Lower/Mangler.cpp
+++ b/flang/lib/Lower/Mangler.cpp
@@ -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"
diff --git a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
index 9fde5652c828..321a07892b0c 100644
--- a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
+++ b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp
@@ -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>
diff --git a/flang/lib/Optimizer/Transforms/MemRefDataFlowOpt.cpp b/flang/lib/Optimizer/Transforms/MemRefDataFlowOpt.cpp
index 9aad37062ad0..cf6545314880 100644
--- a/flang/lib/Optimizer/Transforms/MemRefDataFlowOpt.cpp
+++ b/flang/lib/Optimizer/Transforms/MemRefDataFlowOpt.cpp
@@ -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>
diff --git a/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp b/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
index 05ddcfe1abc9..25f161ccdf7e 100644
--- a/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
+++ b/flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
@@ -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>
More information about the flang-commits
mailing list