[PATCH] D134388: [Analysis] Make members of InlineCost const (NFC)

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 14:47:43 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9ac934d1bf57: [Analysis] Make members of InlineCost const (NFC) (authored by kazu).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134388/new/

https://reviews.llvm.org/D134388

Files:
  llvm/include/llvm/Analysis/InlineCost.h


Index: llvm/include/llvm/Analysis/InlineCost.h
===================================================================
--- llvm/include/llvm/Analysis/InlineCost.h
+++ llvm/include/llvm/Analysis/InlineCost.h
@@ -90,16 +90,16 @@
   enum SentinelValues { AlwaysInlineCost = INT_MIN, NeverInlineCost = INT_MAX };
 
   /// The estimated cost of inlining this callsite.
-  int Cost = 0;
+  const int Cost = 0;
 
   /// The adjusted threshold against which this cost was computed.
-  int Threshold = 0;
+  const int Threshold = 0;
 
   /// Must be set for Always and Never instances.
-  const char *Reason = nullptr;
+  const char *const Reason = nullptr;
 
   /// The cost-benefit pair computed by cost-benefit analysis.
-  Optional<CostBenefitPair> CostBenefit = None;
+  const Optional<CostBenefitPair> CostBenefit = None;
 
   // Trivial constructor, interesting logic in the factory functions below.
   InlineCost(int Cost, int Threshold, const char *Reason = nullptr,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134388.462014.patch
Type: text/x-patch
Size: 963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220921/8706b5d3/attachment.bin>


More information about the llvm-commits mailing list