[PATCH] D126137: [X86] Add support for `-mharden-sls=all`

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 26 14:33:25 PDT 2022


nickdesaulniers added inline comments.


================
Comment at: clang/docs/ClangCommandLineReference.rst:368
 
-Select straight-line speculation hardening scope
+Select straight-line speculation hardening scope (AArch64/X86 only). <arg> must be 'all', 'none', 'retbr'(AArch64), 'blr'(AArch64), 'return'(X86), 'indirect-branch'(X86)
 
----------------
MaskRay wrote:
> This file is generated occasionally. Please don't modify it.
ah, it's generated from the clang/include/clang/Driver/Options.td HelpText for this option. Yeah, that should be updated.


================
Comment at: clang/lib/Driver/ToolChains/Arch/X86.cpp:257
+    } else if (Scope != "none") {
+      D.Diag(diag::err_invalid_sls_hardening) << Scope << A->getAsString(Args);
+    }
----------------
MaskRay wrote:
> The convention is `err_drv_unsupported_option_argument`. Don't add a new kind.
Disagree. Look at https://reviews.llvm.org/D81404. It's not a new diagnostic; passing an unexpected value for the equals flag is precisely what err_invalid_sls_hardening is for.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126137/new/

https://reviews.llvm.org/D126137



More information about the cfe-commits mailing list