[llvm] 013afcf - [Analysis] Use std::optional in ProfileSummaryInfo.h (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 12:18:48 PST 2022


Author: Kazu Hirata
Date: 2022-11-27T12:18:23-08:00
New Revision: 013afcfeb2abdbf06f61fbf719002c739ec49975

URL: https://github.com/llvm/llvm-project/commit/013afcfeb2abdbf06f61fbf719002c739ec49975
DIFF: https://github.com/llvm/llvm-project/commit/013afcfeb2abdbf06f61fbf719002c739ec49975.diff

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
index 773784ac418c..f67dfa1bc24f 100644
--- a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
+++ b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h
@@ -19,6 +19,7 @@
 #include "llvm/IR/ProfileSummary.h"
 #include "llvm/Pass.h"
 #include <memory>
+#include <optional>
 
 namespace llvm {
 class BasicBlock;
@@ -42,15 +43,15 @@ class ProfileSummaryInfo {
   std::unique_ptr<ProfileSummary> Summary;
   void computeThresholds();
   // Count thresholds to answer isHotCount and isColdCount queries.
-  Optional<uint64_t> HotCountThreshold, ColdCountThreshold;
+  std::optional<uint64_t> HotCountThreshold, ColdCountThreshold;
   // True if the working set size of the code is considered huge,
   // because the number of profile counts required to reach the hot
   // percentile is above a huge threshold.
-  Optional<bool> HasHugeWorkingSetSize;
+  std::optional<bool> HasHugeWorkingSetSize;
   // True if the working set size of the code is considered large,
   // because the number of profile counts required to reach the hot
   // percentile is above a large threshold.
-  Optional<bool> HasLargeWorkingSetSize;
+  std::optional<bool> HasLargeWorkingSetSize;
   // Compute the threshold for a given cutoff.
   Optional<uint64_t> computeThreshold(int PercentileCutoff) const;
   // The map that caches the threshold values. The keys are the percentile


        


More information about the llvm-commits mailing list