[clang] [ubsan] Connect -fsanitize-skip-hot-cutoff to LowerAllowCheckPass<cutoffs> (PR #124857)

Thurston Dang via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 29 16:42:48 PST 2025


================
@@ -43,6 +44,23 @@ std::optional<double> SanitizerMaskCutoffs::operator[](unsigned Kind) const {
 
 void SanitizerMaskCutoffs::clear(SanitizerMask K) { set(K, 0); }
 
+std::optional<std::vector<int>>
+SanitizerMaskCutoffs::getAllScaled(int ScalingFactor) const {
+  std::vector<int> scaledCutoffs;
+
+  bool anyNonZero = false;
+  for (unsigned int i = 0; i < SanitizerKind::SO_Count; ++i) {
+    int scaled = round((operator[](i)).value_or(0) * ScalingFactor);
----------------
thurstond wrote:

Changed to lround

See earlier comment about clamping

https://github.com/llvm/llvm-project/pull/124857


More information about the cfe-commits mailing list