[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 6 20:40:00 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) {
----------------
MaskRay wrote:

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

 It's not necessary to mention 

> This is especially important because some build systems, like xcbuild and somewhat clumsy Makefiles, will pass
C_FLAGS to Clang while building assembly files.

since this is general and applies to other options. No need to emphasize it specifically for bounds checking.

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


More information about the cfe-commits mailing list