[clang] [Clang][RISCV] Add preprocessor macros for Zicfilp CFI scheme (PR #109600)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 25 11:02:59 PDT 2024


================
@@ -134,6 +134,25 @@ class RISCVTargetInfo : public TargetInfo {
 
   bool validateGlobalRegisterVariable(StringRef RegName, unsigned RegSize,
                                       bool &HasSizeMismatch) const override;
+
+  bool checkCFProtectionBranchSupported() const override {
+    return ISAInfo->hasExtension("zicfilp");
----------------
topperc wrote:

Branch protection doesn't really require zicfilp. The encoding of lpad is a valid encoding on all RISC-V CPUs. That's why x86 only checks that the CPU is at least a PentiumPro.

https://github.com/llvm/llvm-project/pull/109600


More information about the cfe-commits mailing list