[PATCH] D137317: [X86][CET] Add Diags for targets pre to i686 for `-fcf-protection`

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 21:38:49 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG525167829727: [X86][CET] Add Diags for targets pre to i686 for `-fcf-protection` (authored by pengfei).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137317

Files:
  clang/lib/Basic/Targets/X86.h


Index: clang/lib/Basic/Targets/X86.h
===================================================================
--- clang/lib/Basic/Targets/X86.h
+++ clang/lib/Basic/Targets/X86.h
@@ -241,12 +241,16 @@
 
   bool
   checkCFProtectionReturnSupported(DiagnosticsEngine &Diags) const override {
-    return true;
+    if (CPU == llvm::X86::CK_None || CPU >= llvm::X86::CK_PentiumPro)
+      return true;
+    return TargetInfo::checkCFProtectionReturnSupported(Diags);
   };
 
   bool
   checkCFProtectionBranchSupported(DiagnosticsEngine &Diags) const override {
-    return true;
+    if (CPU == llvm::X86::CK_None || CPU >= llvm::X86::CK_PentiumPro)
+      return true;
+    return TargetInfo::checkCFProtectionBranchSupported(Diags);
   };
 
   virtual bool validateOperandSize(const llvm::StringMap<bool> &FeatureMap,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137317.473120.patch
Type: text/x-patch
Size: 812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221104/ebd25291/attachment.bin>


More information about the cfe-commits mailing list