[PATCH] D54763: [clang][slh] Forward mSLH only to Clang CC1

Zola Bridges via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 26 10:16:30 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC347582: [clang][slh] Forward mSLH only to Clang CC1 (authored by zbrid, committed by ).
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D54763?vs=174813&id=175286#toc

Repository:
  rC Clang

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

https://reviews.llvm.org/D54763

Files:
  lib/Driver/ToolChains/Clang.cpp
  test/CodeGen/attr-speculative-load-hardening.c


Index: test/CodeGen/attr-speculative-load-hardening.c
===================================================================
--- test/CodeGen/attr-speculative-load-hardening.c
+++ test/CodeGen/attr-speculative-load-hardening.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -mspeculative-load-hardening -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s -check-prefix=SLH
+// RUN: %clang -mno-speculative-load-hardening -S -emit-llvm %s -o - | FileCheck %s -check-prefix=NOSLH
 //
 // Check that we set the attribute on each function.
 
@@ -8,3 +9,7 @@
 // SLH: @{{.*}}test1{{.*}}[[SLH:#[0-9]+]]
 
 // SLH: attributes [[SLH]] = { {{.*}}speculative_load_hardening{{.*}} }
+
+// NOSLH: @{{.*}}test1{{.*}}[[NOSLH:#[0-9]+]]
+
+// NOSLH-NOT: attributes [[SLH]] = { {{.*}}speculative_load_hardening{{.*}} }
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -4452,8 +4452,9 @@
 
   Args.AddLastArg(CmdArgs, options::OPT_pthread);
 
-  Args.AddLastArg(CmdArgs, options::OPT_mspeculative_load_hardening,
-                  options::OPT_mno_speculative_load_hardening);
+  if (Args.hasFlag(options::OPT_mspeculative_load_hardening, options::OPT_mno_speculative_load_hardening,
+                   false))
+    CmdArgs.push_back(Args.MakeArgString("-mspeculative-load-hardening"));
 
   RenderSSPOptions(TC, Args, CmdArgs, KernelOrKext);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54763.175286.patch
Type: text/x-patch
Size: 1451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181126/229e8752/attachment-0001.bin>


More information about the cfe-commits mailing list