[llvm] 1226028 - [Analysis] Use std::optional in TargetTransformInfo.h (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 27 12:18:51 PST 2022
Author: Kazu Hirata
Date: 2022-11-27T12:18:26-08:00
New Revision: 1226028729e358e3259afeed2c1ccc9f47a367cb
URL: https://github.com/llvm/llvm-project/commit/1226028729e358e3259afeed2c1ccc9f47a367cb
DIFF: https://github.com/llvm/llvm-project/commit/1226028729e358e3259afeed2c1ccc9f47a367cb.diff
LOG: [Analysis] Use std::optional in TargetTransformInfo.h (NFC)
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:
llvm/include/llvm/Analysis/TargetTransformInfo.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index 4f368d94ac92..592f1146b5cd 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -30,6 +30,7 @@
#include "llvm/Support/BranchProbability.h"
#include "llvm/Support/InstructionCost.h"
#include <functional>
+#include <optional>
#include <utility>
namespace llvm {
@@ -2640,7 +2641,7 @@ class TargetIRAnalysis : public AnalysisInfoMixin<TargetIRAnalysis> {
/// and is queried by passes.
class TargetTransformInfoWrapperPass : public ImmutablePass {
TargetIRAnalysis TIRA;
- Optional<TargetTransformInfo> TTI;
+ std::optional<TargetTransformInfo> TTI;
virtual void anchor();
More information about the llvm-commits
mailing list