[clang] [llvm] [Clang][ARM][AArch64] Alway emit protection attributes for functions. (PR #82819)

Tomas Matheson via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 05:21:12 PDT 2024


================
@@ -2323,15 +2323,33 @@ void Verifier::verifyFunctionAttrs(FunctionType *FT, AttributeList Attrs,
     if (S != "a_key" && S != "b_key")
       CheckFailed("invalid value for 'sign-return-address-key' attribute: " + S,
                   V);
+    if (auto AA = Attrs.getFnAttr("sign-return-address"); !AA.isValid()) {
+      CheckFailed("invalid value for 'sign-return-address-key' present without "
+                  "sign-return-address ");
+    }
   }
 
   if (auto A = Attrs.getFnAttr("branch-target-enforcement"); A.isValid()) {
     StringRef S = A.getValueAsString();
-    if (S != "true" && S != "false")
+    if (S != "" && S != "true" && S != "false")
----------------
tmatheson-arm wrote:

Do we actually need to support reading the old IR?

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


More information about the llvm-commits mailing list