[clang] [sanitizer] Parse weighted sanitizer args and -fno-sanitize-top-hot (PR #121619)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 7 18:52:56 PST 2025


================
@@ -46,26 +47,20 @@ bool clang::parseSanitizerWeightedValue(StringRef Value, bool AllowGroups,
 #include "clang/Basic/Sanitizers.def"
                                  .Default(SanitizerMask());
 
-  if (ParsedKind) {
-    size_t equalsIndex = Value.find_first_of('=');
-    if (equalsIndex != llvm::StringLiteral::npos) {
-      double arg;
-      if ((Value.size() > (equalsIndex + 1)) &&
-          !Value.substr(equalsIndex + 1).getAsDouble(arg)) {
-        // AllowGroups is already taken into account for ParsedKind,
-        // hence we unconditionally expandSanitizerGroups.
-        SanitizerMask ExpandedKind = expandSanitizerGroups(ParsedKind);
-
-        for (unsigned int i = 0; i < SanitizerKind::SO_Count; i++)
-          if (ExpandedKind & SanitizerMask::bitPosToMask(i))
-            Cutoffs[i] = arg;
-
-        return true;
-      }
-    }
-  }
-
-  return false;
+  if (!ParsedKind)
----------------
vitalybuka wrote:

No opinion, we can move when needed

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


More information about the cfe-commits mailing list