From 379e68a763097bed55556c6dc7453e4b732e3d68 Mon Sep 17 00:00:00 2001 From: Zola Bridges Date: Mon, 11 May 2020 11:27:29 -0700 Subject: [clang][SLH] Add __has_feature(speculative_load_hardening) SLH doesn't support asm goto and is unlikely to ever support it. Users of asm goto need a way to choose whether to use asm goto or fallback to an SLH compatible code path when SLH is enabled. This feature flag will give users this ability. Tested via unit test Reviewed By: mattdr Differential Revision: https://reviews.llvm.org/D79733 --- clang/lib/Frontend/CompilerInvocation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 2d6f4be..649e78e 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3382,6 +3382,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, } Opts.BranchTargetEnforcement = Args.hasArg(OPT_mbranch_target_enforce); + Opts.SpeculativeLoadHardening = Args.hasArg(OPT_mspeculative_load_hardening); } static bool isStrictlyPreprocessorAction(frontend::ActionKind Action) { -- cgit v1.1