[clang] [Driver][BoundsSafety] Add -fexperimental-bounds-safety flag (PR #70480)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 9 15:04:45 PST 2023


================
@@ -3618,6 +3618,27 @@ void CompilerInvocationBase::GenerateLangArgs(const LangOptions &Opts,
     GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed);
 }
 
+static void CheckBoundsSafetyLang(InputKind IK, DiagnosticsEngine &Diags) {
----------------
rapidsna wrote:

> I think it's better to handle this language check in Driver, similar to `OPT_fminimize_whitespace` but for all `Inputs`.

@MaskRay Thanks for the review! I made it a driver error here: 
[f125532](https://github.com/llvm/llvm-project/pull/70480/commits/f125532235d5120027ec261204ae09d315d0fa14)

We also keep the -cc1 check in order to prevent it from running with an unsupported mode (we still need some checks in cc1 anyway in case we want to silently ignore the option, instead of triggering the broken mode).

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


More information about the cfe-commits mailing list