From a7789c6bb3ee54f194ad10fd697ebf490591a0e2 Mon Sep 17 00:00:00 2001 From: Fedor Sergeev Date: Thu, 27 Jun 2019 23:41:03 +0000 Subject: [PATCH] [InlineCost] make InlineCost assignable Summary: Current InlineCost is not assignable because of const members Cost and Threshold. I dont see practical benefits from having them const (access to these members is private and internal interactions are rather simple). On other hand that makes it hard to use as a member in some other data structure where assignability is necessary. I'm going to use InlineCost in a downstream inliner that maintains a complex queue of candidate call-sites and thus keeping and recalculating InlineCost is necessary. This patch just removes 'const' from both members, making InlineCost assignable. Reviewers: eraman, greened, chandlerc, yrouban, apilipenko Reviewed By: apilipenko Tags: #llvm Differential Revision: https://reviews.llvm.org/D63823 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364612 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/InlineCost.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llvm/Analysis/InlineCost.h b/include/llvm/Analysis/InlineCost.h index d937308aed7..611c9de24e4 100644 --- a/include/llvm/Analysis/InlineCost.h +++ b/include/llvm/Analysis/InlineCost.h @@ -67,10 +67,10 @@ class InlineCost { }; /// The estimated cost of inlining this callsite. - const int Cost; + int Cost; /// The adjusted threshold against which this cost was computed. - const int Threshold; + int Threshold; /// Must be set for Always and Never instances. const char *Reason = nullptr; -- 2.50.1