[PATCH] D79733: [clang][SLH] Add __has_feature(speculative_load_hardening)

Matthew Riley via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 11 12:56:09 PDT 2020


mattdr added subscribers: rsmith, mattdr.
mattdr added inline comments.


================
Comment at: clang/include/clang/Basic/LangOptions.def:369
 
+BENIGN_LANGOPT(SpeculativeLoadHardeningEnabled, 1, 0,
+               "Speculative load hardening enabled")
----------------
I've read the description of `LANGOPT`, `COMPATIBLE_LANGOPT`, and `BENIGN_LANGOPT` a few times and, though I'm still not //confident//, I //think// this should be `LANGOPT`.

A few reasons:
1. We actually expect the SLH setting to be the same throughout a compiled binary, so it **shouldn't** differ between modules and the consequences if it does are already not well defined
2. Looking through the other `BENIGN_LANGOPT`s, many seem to describe changing the boundaries for programs that will be accepted/rejected at parsing, which doesn't read on SLH.
3. We're adding this so we can use `__has_feature` to change the code that's compiled (e.g. avoiding `asm goto`), so we definitely anticipate cases where the setting for this option changes the AST in semantic ways

@rsmith -- can you please check my math?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79733





More information about the cfe-commits mailing list