[llvm] 4c88bc5 - [Analysis] Use std::optional in InlineCost.h (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 11:49:25 PST 2022


Author: Kazu Hirata
Date: 2022-11-27T11:49:05-08:00
New Revision: 4c88bc5017d28ba219d6f6272bd654727cdc6452

URL: https://github.com/llvm/llvm-project/commit/4c88bc5017d28ba219d6f6272bd654727cdc6452
DIFF: https://github.com/llvm/llvm-project/commit/4c88bc5017d28ba219d6f6272bd654727cdc6452.diff

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/InlineCost.h b/llvm/include/llvm/Analysis/InlineCost.h
index 6596cb3375e1..731e79f8de3f 100644
--- a/llvm/include/llvm/Analysis/InlineCost.h
+++ b/llvm/include/llvm/Analysis/InlineCost.h
@@ -20,6 +20,7 @@
 #include "llvm/IR/PassManager.h"
 #include <cassert>
 #include <climits>
+#include <optional>
 
 namespace llvm {
 class AssumptionCache;
@@ -227,13 +228,13 @@ struct InlineParams {
   Optional<int> ColdCallSiteThreshold;
 
   /// Compute inline cost even when the cost has exceeded the threshold.
-  Optional<bool> ComputeFullInlineCost;
+  std::optional<bool> ComputeFullInlineCost;
 
   /// Indicate whether we should allow inline deferral.
-  Optional<bool> EnableDeferral;
+  std::optional<bool> EnableDeferral;
 
   /// Indicate whether we allow inlining for recursive call.
-  Optional<bool> AllowRecursiveCall = false;
+  std::optional<bool> AllowRecursiveCall = false;
 };
 
 Optional<int> getStringFnAttrAsInt(CallBase &CB, StringRef AttrKind);


        


More information about the llvm-commits mailing list