[Analysis] Use std::optional in TargetTransformInfo.h (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 20:18:26 +0000 (12:18 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 20:18:26 +0000 (12:18 -0800)
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

llvm/include/llvm/Analysis/TargetTransformInfo.h

index 4f368d9..592f114 100644 (file)
@@ -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 @@ private:
 /// and is queried by passes.
 class TargetTransformInfoWrapperPass : public ImmutablePass {
   TargetIRAnalysis TIRA;
-  Optional<TargetTransformInfo> TTI;
+  std::optional<TargetTransformInfo> TTI;
 
   virtual void anchor();