This is an archive of the discontinued LLVM Phabricator instance.

[Analysis] Make members of InlineCost const (NFC)
ClosedPublic

Authored by kazu on Sep 21 2022, 2:38 PM.

Details

Summary

Once we create an instance of InlineCost, we don't change its
contents.

Diff Detail

Event Timeline

kazu created this revision.Sep 21 2022, 2:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 2:38 PM
Herald added a subscriber: haicheng. · View Herald Transcript
kazu requested review of this revision.Sep 21 2022, 2:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 2:38 PM
mtrofin accepted this revision.Sep 21 2022, 2:44 PM
This revision is now accepted and ready to land.Sep 21 2022, 2:44 PM
This revision was landed with ongoing or failed builds.Sep 21 2022, 2:47 PM
This revision was automatically updated to reflect the committed changes.

It is very inconvenient to have non-static const fields.
In our downstream source we have a field of InlineCost that is changing. With this patch we cannot change the value of the field. The same problem is with locals of InlineCost type.
Consider reverting this patch, please.

kazu added a comment.Sep 23 2022, 9:51 AM

It is very inconvenient to have non-static const fields.
In our downstream source we have a field of InlineCost that is changing. With this patch we cannot change the value of the field. The same problem is with locals of InlineCost type.
Consider reverting this patch, please.

Sure. I just reverted the patch.