[PATCH] D60751: [NFC][InlineCost] cleanup - comments, overflow handling.

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 00:42:02 PDT 2019


yrouban added inline comments.


================
Comment at: lib/Analysis/InlineCost.cpp:247
+  /// Handle a capped 'int' increment for Cost.
+  void addCost(int64_t Inc, int64_t UpperBound = INT_MAX) {
+    Cost = std::min(UpperBound, Cost + Inc);
----------------
I believe that both //Inc// and //UpperBound// must be of the same type as //Cost// (i.e. //int//) but the parameters of std::max() should be extended.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60751





More information about the llvm-commits mailing list