Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Feb 2018 17:08:09 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r328788 - in vendor/clang/dist-release_60: include/clang/Driver lib/Basic/Targets test/Driver
Message-ID:  <201802021708.w12H898x080243@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Fri Feb  2 17:08:09 2018
New Revision: 328788
URL: https://svnweb.freebsd.org/changeset/base/328788

Log:
  Vendor import of clang release_60 branch r324090:
  https://llvm.org/svn/llvm-project/cfe/branches/release_60@324090

Modified:
  vendor/clang/dist-release_60/include/clang/Driver/Options.td
  vendor/clang/dist-release_60/lib/Basic/Targets/X86.cpp
  vendor/clang/dist-release_60/lib/Basic/Targets/X86.h
  vendor/clang/dist-release_60/test/Driver/x86-target-features.c

Modified: vendor/clang/dist-release_60/include/clang/Driver/Options.td
==============================================================================
--- vendor/clang/dist-release_60/include/clang/Driver/Options.td	Fri Feb  2 17:08:01 2018	(r328787)
+++ vendor/clang/dist-release_60/include/clang/Driver/Options.td	Fri Feb  2 17:08:09 2018	(r328788)
@@ -2583,6 +2583,10 @@ def mshstk : Flag<["-"], "mshstk">, Group<m_x86_Featur
 def mno_shstk : Flag<["-"], "mno-shstk">, Group<m_x86_Features_Group>;
 def mibt : Flag<["-"], "mibt">, Group<m_x86_Features_Group>;
 def mno_ibt : Flag<["-"], "mno-ibt">, Group<m_x86_Features_Group>;
+def mretpoline : Flag<["-"], "mretpoline">, Group<m_x86_Features_Group>;
+def mno_retpoline : Flag<["-"], "mno-retpoline">, Group<m_x86_Features_Group>;
+def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<m_x86_Features_Group>;
+def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
 
 // These are legacy user-facing driver-level option spellings. They are always
 // aliases for options that are spelled using the more common Unix / GNU flag

Modified: vendor/clang/dist-release_60/lib/Basic/Targets/X86.cpp
==============================================================================
--- vendor/clang/dist-release_60/lib/Basic/Targets/X86.cpp	Fri Feb  2 17:08:01 2018	(r328787)
+++ vendor/clang/dist-release_60/lib/Basic/Targets/X86.cpp	Fri Feb  2 17:08:09 2018	(r328788)
@@ -763,6 +763,10 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<s
       HasPREFETCHWT1 = true;
     } else if (Feature == "+clzero") {
       HasCLZERO = true;
+    } else if (Feature == "+retpoline") {
+      HasRetpoline = true;
+    } else if (Feature == "+retpoline-external-thunk") {
+      HasRetpolineExternalThunk = true;
     }
 
     X86SSEEnum Level = llvm::StringSwitch<X86SSEEnum>(Feature)
@@ -1305,6 +1309,8 @@ bool X86TargetInfo::hasFeature(StringRef Feature) cons
       .Case("prfchw", HasPRFCHW)
       .Case("rdrnd", HasRDRND)
       .Case("rdseed", HasRDSEED)
+      .Case("retpoline", HasRetpoline)
+      .Case("retpoline-external-thunk", HasRetpolineExternalThunk)
       .Case("rtm", HasRTM)
       .Case("sgx", HasSGX)
       .Case("sha", HasSHA)

Modified: vendor/clang/dist-release_60/lib/Basic/Targets/X86.h
==============================================================================
--- vendor/clang/dist-release_60/lib/Basic/Targets/X86.h	Fri Feb  2 17:08:01 2018	(r328787)
+++ vendor/clang/dist-release_60/lib/Basic/Targets/X86.h	Fri Feb  2 17:08:09 2018	(r328788)
@@ -96,6 +96,8 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public T
   bool HasCLWB = false;
   bool HasMOVBE = false;
   bool HasPREFETCHWT1 = false;
+  bool HasRetpoline = false;
+  bool HasRetpolineExternalThunk = false;
 
   /// \brief Enumeration of all of the X86 CPUs supported by Clang.
   ///

Modified: vendor/clang/dist-release_60/test/Driver/x86-target-features.c
==============================================================================
--- vendor/clang/dist-release_60/test/Driver/x86-target-features.c	Fri Feb  2 17:08:01 2018	(r328787)
+++ vendor/clang/dist-release_60/test/Driver/x86-target-features.c	Fri Feb  2 17:08:09 2018	(r328788)
@@ -125,3 +125,12 @@
 // VBMI2: "-target-feature" "+avx512vbmi2"
 // NO-VBMI2: "-target-feature" "-avx512vbmi2"
 
+// RUN: %clang -target i386-linux-gnu -mretpoline %s -### -o %t.o 2>&1 | FileCheck -check-prefix=RETPOLINE %s
+// RUN: %clang -target i386-linux-gnu -mno-retpoline %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-RETPOLINE %s
+// RETPOLINE: "-target-feature" "+retpoline"
+// NO-RETPOLINE: "-target-feature" "-retpoline"
+
+// RUN: %clang -target i386-linux-gnu -mretpoline -mretpoline-external-thunk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=RETPOLINE-EXTERNAL-THUNK %s
+// RUN: %clang -target i386-linux-gnu -mretpoline -mno-retpoline-external-thunk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-RETPOLINE-EXTERNAL-THUNK %s
+// RETPOLINE-EXTERNAL-THUNK: "-target-feature" "+retpoline-external-thunk"
+// NO-RETPOLINE-EXTERNAL-THUNK: "-target-feature" "-retpoline-external-thunk"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802021708.w12H898x080243>