[clang] [sanitizer] Refactor -f(no-)?sanitize-recover parsing (PR #119819)
Vitaly Buka via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 17 10:15:24 PST 2024
================
@@ -247,48 +247,72 @@ static SanitizerMask setGroupBits(SanitizerMask Kinds) {
return Kinds;
}
-// Computes the sanitizer mask based on the default plus opt-in (if supported)
-// minus opt-out.
+// Computes the sanitizer mask as:
+// Default + AlwaysIn + Arguments - AlwaysOut
+// with arguments parsed from left to right.
+//
+// Error messages are optionally printed if the AlwaysIn or AlwaysOut
+// invariants are violated.
static SanitizerMask
parseSanitizeArgs(const Driver &D, const llvm::opt::ArgList &Args,
- bool DiagnoseErrors, SanitizerMask Supported,
- SanitizerMask Default, int OptInID, int OptOutID) {
- SanitizerMask Remove; // During the loop below, the accumulated set of
- // sanitizers disabled by the current sanitizer
- // argument or any argument after it.
- SanitizerMask Kinds;
- SanitizerMask SupportedWithGroups = setGroupBits(Supported);
-
- for (const llvm::opt::Arg *Arg : llvm::reverse(Args)) {
+ bool DiagnoseErrors, SanitizerMask Default,
+ SanitizerMask AlwaysIn, SanitizerMask AlwaysOut, int OptInID,
+ int OptOutID) {
+
----------------
vitalybuka wrote:
we may need asssert(AlwaysIn & AlwaysOut is empty)
https://github.com/llvm/llvm-project/pull/119819
More information about the cfe-commits
mailing list