[clang] 424e850 - [clang][ARM] Re-word PACBTI warning.

Amilendra Kodithuwakku via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 8 11:13:08 PST 2022


Author: Amilendra Kodithuwakku
Date: 2022-02-08T19:13:02Z
New Revision: 424e850f1ebc3e7011cb4af44cb2d62c02a58fbe

URL: https://github.com/llvm/llvm-project/commit/424e850f1ebc3e7011cb4af44cb2d62c02a58fbe
DIFF: https://github.com/llvm/llvm-project/commit/424e850f1ebc3e7011cb4af44cb2d62c02a58fbe.diff

LOG: [clang][ARM] Re-word PACBTI warning.

The original warning added in D115501 when pacbti is used with an
incompatible architecture was not exactly correct because it was
not really ignored and can affect codegen.

Therefore reword to say that the pacbti option is incompatible with
the given architecture.

Reviewed By: chill

Differential Revision: https://reviews.llvm.org/D119166

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticCommonKinds.td
    clang/lib/Driver/ToolChains/Clang.cpp
    clang/test/Driver/arm-security-options.c

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td
index 5ea55b0fd31ba..421527827a4bd 100644
--- a/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -145,8 +145,8 @@ def warn_conflicting_nullability_attr_overriding_param_types : Warning<
 def err_nullability_conflicting : Error<
   "nullability specifier %0 conflicts with existing specifier %1">;
 
-def warn_target_unsupported_branch_protection_option: Warning <
-  "ignoring '-mbranch-protection=' option because the '%0' architecture does not support it">,
+def warn_incompatible_branch_protection_option: Warning <
+  "'-mbranch-protection=' option is incompatible with the '%0' architecture">,
   InGroup<BranchProtection>;
 
 def warn_target_unsupported_branch_protection_attribute: Warning <

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index cfeb965f99e2f..ddc9926aef87a 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1639,7 +1639,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args,
   const Driver &D = TC.getDriver();
   const llvm::Triple &Triple = TC.getEffectiveTriple();
   if (!(isAArch64 || (Triple.isArmT32() && Triple.isArmMClass())))
-    D.Diag(diag::warn_target_unsupported_branch_protection_option)
+    D.Diag(diag::warn_incompatible_branch_protection_option)
         << Triple.getArchName();
 
   StringRef Scope, Key;

diff  --git a/clang/test/Driver/arm-security-options.c b/clang/test/Driver/arm-security-options.c
index 79367d7bbb965..fc1b5da78d2cf 100644
--- a/clang/test/Driver/arm-security-options.c
+++ b/clang/test/Driver/arm-security-options.c
@@ -90,4 +90,4 @@
 // BAD-B-KEY-COMBINATION: invalid branch protection option 'b-key' in '-mbranch-protection={{.*}}'
 // BAD-LEAF-COMBINATION: invalid branch protection option 'leaf' in '-mbranch-protection={{.*}}'
 
-// INCOMPATIBLE-ARCH: ignoring '-mbranch-protection=' option because the '{{.*}}' architecture does not support it
+// INCOMPATIBLE-ARCH: '-mbranch-protection=' option is incompatible with the '{{.*}}' architecture


        


More information about the cfe-commits mailing list