tejohnson added inline comments.
================ Comment at: llvm/lib/Transforms/Utils/MisExpect.cpp:150 +// TODO: when clang allows c++17, use std::clamp instead +uint32_t clamp(uint64_t value, uint32_t hi, uint32_t low) { + if (value > hi) ---------------- Nit: seems more intuitive to pass low before high. But not sure the low is needed in this case, see comment at callsite. ================ Comment at: llvm/lib/Transforms/Utils/MisExpect.cpp:201 + auto Tolerance = getMisExpectTolerance(I.getContext()); + Tolerance = clamp(Tolerance, 99, 0); + ---------------- Looks like Tolerance is unsigned, as are the arguments to clamp. So it can never go below 0. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115907/new/ https://reviews.llvm.org/D115907 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits