summaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2024-08-21 17:47:17 -0700
committerVitaly Buka <vitalybuka@google.com>2024-08-21 17:47:17 -0700
commit54081b7e4a315cdbe1017eeded9e2cf861ecc0b4 (patch)
treed7a4ed030ea94cd06ff903d648901fbe339a55bd /clang/lib/Frontend/CompilerInvocation.cpp
parentee572ed4ac2d9e2ff37217d6bedc20f530a5d3af (diff)
parent64e464349bfca0d90e07f6db2f710d4d53cdacd4 (diff)
[𝘀𝗽𝗿] changes introduced through rebaseusers/vitalybuka/spr/main.asandarwin-simplify-test
Created using spr 1.3.4 [skip ci]
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index e3911c281985..f510d3067d4d 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4267,6 +4267,20 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << Val;
}
+ if (auto *A =
+ Args.getLastArg(OPT_fsanitize_undefined_ignore_overflow_pattern_EQ)) {
+ for (int i = 0, n = A->getNumValues(); i != n; ++i) {
+ Opts.OverflowPatternExclusionMask |=
+ llvm::StringSwitch<unsigned>(A->getValue(i))
+ .Case("none", LangOptionsBase::None)
+ .Case("all", LangOptionsBase::All)
+ .Case("add-overflow-test", LangOptionsBase::AddOverflowTest)
+ .Case("negated-unsigned-const", LangOptionsBase::NegUnsignedConst)
+ .Case("post-decr-while", LangOptionsBase::PostDecrInWhile)
+ .Default(0);
+ }
+ }
+
// Parse -fsanitize= arguments.
parseSanitizerKinds("-fsanitize=", Args.getAllArgValues(OPT_fsanitize_EQ),
Diags, Opts.Sanitize);