================ @@ -3618,6 +3618,30 @@ void CompilerInvocationBase::GenerateLangArgs(const LangOptions &Opts, GenerateArg(Consumer, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed); } +static void CheckBoundsSafetyLang(InputKind IK, DiagnosticsEngine &Diags) { + // Currently, bounds safety is only supported for C. However, it's also + // possible to pass assembly files and LLVM IR through Clang, and + // those should be trivially supported. This is especially important because + // some build systems, like xcbuild and somewhat clumsy Makefiles, will pass + // C_FLAGS to Clang while building assembly files. + switch (IK.getLanguage()) { + case Language::Asm: + Diags.Report(diag::warn_bounds_safety_asm_ignored); + break; ---------------- rapidsna wrote:
Right, this is something we could potentially allow in future if we see actual use cases. Until we support this, `__has_feature(bounds_safety)` or such will return `false` and we should have the compiler report the warning that `-fbounds-safety` is ignored for assemblers. https://github.com/llvm/llvm-project/pull/70480 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits