[llvm] 9178753 - [Support] Use std::optional in CachePruning.h (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 14:16:20 PST 2022


Author: Kazu Hirata
Date: 2022-11-27T14:16:01-08:00
New Revision: 9178753e639378a88ba3707e48a2c8a20cb8b0f2

URL: https://github.com/llvm/llvm-project/commit/9178753e639378a88ba3707e48a2c8a20cb8b0f2
DIFF: https://github.com/llvm/llvm-project/commit/9178753e639378a88ba3707e48a2c8a20cb8b0f2.diff

LOG: [Support] Use std::optional in CachePruning.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/Support/CachePruning.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/CachePruning.h b/llvm/include/llvm/Support/CachePruning.h
index c639501f16294..2e8f8fc4c0cf5 100644
--- a/llvm/include/llvm/Support/CachePruning.h
+++ b/llvm/include/llvm/Support/CachePruning.h
@@ -17,6 +17,7 @@
 #include "llvm/ADT/Optional.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include <chrono>
+#include <optional>
 
 namespace llvm {
 
@@ -30,7 +31,7 @@ struct CachePruningPolicy {
   /// directory too often. It does not impact the decision of which file to
   /// prune. A value of 0 forces the scan to occur. A value of None disables
   /// pruning.
-  llvm::Optional<std::chrono::seconds> Interval = std::chrono::seconds(1200);
+  std::optional<std::chrono::seconds> Interval = std::chrono::seconds(1200);
 
   /// The expiration for a file. When a file hasn't been accessed for Expiration
   /// seconds, it is removed from the cache. A value of 0 disables the


        


More information about the llvm-commits mailing list