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

index a323cac..2b5e68f 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "llvm/Analysis/LoopAnalysisManager.h"
 #include "llvm/IR/PassManager.h"
+#include <optional>
 
 namespace llvm {
 
@@ -269,7 +270,7 @@ private:
 
   /// The max. distance between array elements accessed in a loop so that the
   /// elements are classified to have temporal reuse.
-  Optional<unsigned> TRT;
+  std::optional<unsigned> TRT;
 
   const LoopInfo &LI;
   ScalarEvolution &SE;